saved search to pull date invoice was paid in full - netsuite

I've a transaction saved search in which I've various formula columns displaying invoice date, any related credits, and then actual payments after any term discounts taken. Now I need to add another column to display the date invoice was marked "Paid in Full" I'm using the formula which is not working: case when {systemnotes.newvalue} = 'paid in full' then {systemnotes.date} end
I can't use 'date closed' because that's just displays the most recent payment date against an invoice and not the date it was fully applied for example an old credit memo.
Any input is appreciated.

Oracle string comparisons are case sensitive. {systemnotes.newvalue} returns 'Paid In Full' - not 'paid in full' (note the Title Case). You can correct the comparison to use Title Case like this:
case when {systemnotes.newvalue} = 'Paid In Full' then {systemnotes.date} end
or you can coerce both sides to upper or lower case for a slightly more robust comparison:
case when UPPER({systemnotes.newvalue}) = UPPER('paid in full') then {systemnotes.date} end
I've tested both of these and they work for me.

Why not just use the Date Closed? (closedate)

Related

highlight results when item fulfillment date is not same as invoice date

I have saved search which displays invoices when the invoice date is not same as the ship date.I now only need to highlight records when the dates are in different months. For example I already have a saved search list to show invoice if the invoice date was 9/12/19 but the actual ship date on item fulfillment is 9/11/19. Now I would want to highlight this result if these two dates were NOT in the same month.
The formuala I'm using for the saved search results is case when {billingtransaction.trandate} <> {billingtransaction.shipdate} then 1 else 0 end
Now I believe I need a similar case statement which will factor month difference
You can use the function TO_CHAR function to do this:
CASE WHEN TO_CHAR({billingtransaction.trandate}, 'MM') <> TO_CHAR({billingtransaction.shipdate}, 'MM') THEN 1 ELSE 0 END

Date status function to displays Overdue, Due Later and Due Soon

I am currently working on function in Excel that will display the status of an activity based on the due date provided.
This function would display:
"Overdue" if Today()> Due Date;
"Due Soon" If the Due date was within one week
"Due Later" if Today() < Due Date +7
Below is an example of what I was able to muster up:
Function Status_of_Date()
If Sheets("Issue_Log").Range("Due_Date").Value < Date Then
Sheets("Issue_Log").Range("Date_Status").Value = "Overdue" 'overdue
ElseIf Sheets("Issue_Log").Range("Due_Date").Value < 7 + Date Then
Sheets("Issue_Log").Range("Date_Status").Value = "Due Later" ' Due Soon
ElseIf Sheets("Issue_Log").Range("Due_Date").Value > 7 + Date Then
Sheets("Issue_Log").Range("Date_Status").Value = "Due Later" ' Due Later
Else
End If
End Function
Codeless Solution
Add a column to your table, to count the days left - since anything negative is overdue anyway, make all negatives -1:
Use a table formula to calculate it:
=IF([#[Due Date]]-TODAY()<0,-1,[#[Due Date]]-TODAY())
Next, have another table to hold the status given a number of days:
Since you have 3 statuses, and they're really ranges of values, to achieve the values you're after you'll need:
A row with -1 for everything Overdue
A row with 0 for everything due Soon
A row with 7 for everything due Later
Now your "Date Status" column can be a simple VLOOKUP formula:
Again, a table formula is used; note the "approximate match" last parameter:
=VLOOKUP([#Days],tblStatusLookup,2,TRUE)
Adjust tblStatusLookup to whatever you've named your lookup table.
Look 'ma, not a single line of code!
Then you can hide the [Days] column if you don't need it shown, and the lookup table can be anywhere you want - and if the thresholds need to change, or if new statuses need to be added, you just tweak the lookup table (important: keep the [Days] sorted ascending, that's how approximate match VLOOKUP works!)
Bugs in OP
Your function needs to know what row to work with. That should be a parameter; change the signature to accept one - or even better, change it to accept a DueDate parameter - then you simply don't need to care about anything other than the date you're given:
Public Function GetDateStatus(ByVal dueDate As Date) As String
If dueDate - Date < 0 Then
GetDateStatus = "Overdue"
ElseIf dueDate - Date < 7 Then
GetDateStatus = "Due Soon"
Else
GetDateStatus = "Due Later"
End If
End function
And then in your table the formula would be:
=GetDateStatus(#[Due Date])
No need to be bothered with ranges and the nitty-gritty details of how and where every value is coming from - code gets much, much simpler when you work at the right abstraction level!
Note that a worksheet function is not allowed to change other cells' values: it calculates a value.

PowerQuery (M): How can I extract a date from a large text field?

My table has a text column called Remarks which usually contains a large amount of text.
Here's an example:
3/24/2017 11:14:41 AM - EMD FOR STATUS NFU 3/30/17
3/30/2017 10:58:03 AM - CLD PER RECEPTIONIST GM UNAVAILABLE NFU 04-13-2017
4/13/2017 11:10:15 AM - CLD PER RECEPTIONIST WILL GIVE INFO NFU4/27
4/27/2017 9:02:20 AM - MLD INV WITH 90 DAY STAMP
4/27/2017 9:15:03 AM - PER REP WILL CALL CUSTOMER FOR PAYMENT
4/27/2017 11:03:46 AM - NFU 05/5PER REP CUSTOMER CONFUSION
5/5/2017 8:55:17 AM - NFU 5/9/2017 CRP PER REP CHECK WAS MLD 5/2/17
All of that text would be crammed into a single field, and I need to extract the last NFU date from the field for use in calculations and filtering.
In the above example, I would want to extract the date 5/9/2017 from the last row.
But as you can see, the date could be in any format, anywhere in the field.
I presume Excel can parse the text into a date value in any of the above formats (if not, I'll deal with that some other way - employee training, etc.)
The main things I need to figure out how to do using PowerQuery are:
Find the last instance of "NFU" in this field
Extract all text immediately following that last instance of "NFU", including the space between "NFU" and the date, if present.
At this point, the result should be:
" 5/9/2017 CRP PER REP CHECK WAS MLD 5/2/17"
Remove any whitepsace at the beginning of the string.
At this point, the result should be:
"5/9/2017 CRP PER REP CHECK WAS MLD 5/2/17"
Find the first character that is not 0-9, /, or - (or the end of the string, whichever comes first)
Truncate the string at the first non-date character, if appropriate.
At this point, the result should be:
"5/9/2017"
Finally, attempt to format the resulting text into Date type/format, and return as the result for a PowerQuery custom column.
Looking at the PowerQuery string functions available, I'm not sure whether this is even possible.
I guess you mean the Power Query Text functions. These are somewhat limited indeed, but there are plenty other options in Power Query's function library: in this case the List functions can come to the rescue.
By the way: I checked for " NFU" in order to avoid "CONFUSION" (last but one line in your examples).
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
Typed = Table.TransformColumnTypes(Source,{{"example", type text}}),
LastNFU = Table.AddColumn(Typed, "LastNFU", each Text.PositionOf([example]," NFU",Occurrence.Last), Int64.Type),
AfterNFU = Table.AddColumn(LastNFU, "AfterNFU", each if [LastNFU] = -1 then null else Text.Range([example],[LastNFU]+4)),
Trimmed = Table.TransformColumns(AfterNFU,{{"AfterNFU", Text.Trim}}),
TextToList = Table.TransformColumns(Trimmed,{{"AfterNFU", each if _ = null then {} else Text.ToList(_)}}),
ListFirstN = Table.TransformColumns(TextToList,{{"AfterNFU", each List.FirstN(_, each Text.Contains("01234567890-/",_))}}),
TextCombine = Table.TransformColumns(ListFirstN, {"AfterNFU", Text.Combine, type text}),
Date = Table.TransformColumnTypes(TextCombine,{{"AfterNFU", type date}}, "en-US"),
Renamed = Table.RenameColumns(Date,{{"AfterNFU", "Date"}}),
Removed = Table.RemoveColumns(Renamed,{"LastNFU"})
in
Removed
A simple formula like =RIGHT(A1,LEN(A1)-(FIND("NFU",A1,1)-1)) would work to extract the string next to NFU. Assuming the text is at cell A1.
But needs to further drill down to get your other requirements.

Issue with summing ageing in customized customer statement report

The requirement is to print the customer statement without credit memo and pre payment. I have modified the report and added a filter condition to filter only invoices and it works fine.
I am facing an issue in the ageing where the total is not tallying and it included the credit memo and prepayment.
I have tried to recalculate the values and it is not working.
How do I recalculate the ageing which considers the newly added filter condition?
I tangled with this report once and it was a tough exercise. My requirements were different,but in the end I had to tinker with how the variables within the report are calculated based on the data. In the report designer, click on the sections and then click into the variables collections under properties. You can see how the balances are summed and edit the code, put in if statements,etc. Hope that's helpful.
The have followed the below steps
Declared variable for each ageing group in detail band and the value will be reset on document group.
Declared a variable AgeingDays and calculated the date difference between statement date and document due date
=DateDiff( 'd', [ARStatementDetailInfo.DueDate],[#StatementDate] )
Used the following statement to find out the ageing group and stored the value
=$cagb00+Iif($AgeingDays < [ARStatement.AgeDays00], IIf([ARStatement.StatementType]=[#TypeOpenItem],[ARStatementDetailInfo.DocBalanceSigned],[ARStatementDetailInfo.OrigDocAmtSigned]),0)
=$cagb01+Iif($AgeingDays >= [ARStatement.AgeDays00] And $AgeingDays <[ARStatement.AgeDays01] , IIf([ARStatement.StatementType]=[#TypeOpenItem],[ARStatementDetailInfo.DocBalanceSigned],[ARStatementDetailInfo.OrigDocAmtSigned]),0)
=$cagb02+Iif($AgeingDays >= [ARStatement.AgeBalance02] And $AgeingDays < [ARStatement.AgeBalance03], IIf([ARStatement.StatementType]=[#TypeOpenItem],[ARStatementDetailInfo.DocBalanceSigned],[ARStatementDetailInfo.OrigDocAmtSigned]) , 0 )
=$cagb03+Iif($AgeingDays >[ARStatement.AgeBalance03] And $AgeingDays < [ARStatement.AgeBalance04], IIf([ARStatement.StatementType]=[#TypeOpenItem],[ARStatementDetailInfo.DocBalanceSigned],[ARStatementDetailInfo.OrigDocAmtSigned]),0)
=$cagb04+Iif( $AgeingDays >= [ARStatement.AgeDays04], IIf([ARStatement.StatementType]=[#TypeOpenItem],[ARStatementDetailInfo.DocBalanceSigned],[ARStatementDetailInfo.OrigDocAmtSigned]),0)
Declared another set of variable on to sum the value of group level
Finally while printing ageing value, check the flag invoice only and if it is true print the calculated value otherwise the default value
=Iif([#InvoiceOnly], $ca01, $CustAgeBalance01 )
I have tested and my test result are good.

Netsuite Expression for Formula (Date) Field

I am new to the NetSuite expressions and I am using the following formula in a Opportunity Saved Search result but it is returning an Invalid Expression.
I am trying to display the Systems Note Date when an Opportunity Status was changed to 'Suspect'.
CASE WHEN {systemnotes.field} IN {entitystatus} END CASE WHEN {systemnotes.newvalue}=Suspect THEN {systemnotes.date} END
In a single expression, there should only be one CASE and one END and then you can have several WHEN/THEN statements.
Your formula should be more like this:
CASE WHEN {systemnotes.field} = 'Entity Status' AND {systemnotes.newvalue}='Suspect' THEN {systemnotes.date} END
This is assuming you have Suspect as a value for this, but this should be correct

Resources