Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello guys, I am trying to create invoice buckets for one of my clients
first I define my variable like this :
let vDate = Date(Today());
table:
LOAD
Customer,
InvoiceNo,
InvoiceDate,
BookEntryDate,
TransactionNo,
Currency,
"Amount LocCur",
if('$(vDate)' - Date(InvoiceDate)>='7','7 days',
if('$(vDate)' - Date(InvoiceDate)>='30','30 days',
if('$(vDate)' - Date(InvoiceDate)>='90','90 days',
if('$(vDate)' - Date(InvoiceDate)>='180','180 days',
if('$(vDate)' - Date(InvoiceDate)>='360','360 days','Not Yet'))))) as Timebuckets
from ....
But in the Pivot Chart I made with Customers, I see only Not Yet...
What am I doing wrong?
Finally, to make sure the buckets sort correctly:
if($(vDate) - InvoiceDate >= '360', dual('360 days', 360),
if($(vDate) - InvoiceDate >= '180', dual('180 days', 180),
if($(vDate) - InvoiceDate >= '90', dual('90 days', 90),
if($(vDate) - InvoiceDate >= '30', dual('30 days', 30),
if($(vDate) - InvoiceDate >= '7', dual('7 days', 7), dual('Not Yet', 999))))))
Now you can sort them numerically. If you want 'Not Yet' to be he first then use 0 instead of 999.