Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am trying to write the below logic in the script ...
Can please the expertise suggest if this is correct ? or need some alteration in this ?
If (num(today()) - num(Max(Invoicedate)) > 60 , 'Dispatched' , 'Inprogress') as status
thanks in advcance
Hi,
you can try like this, if not working try to share your table structure with small mock date set ? tks
Fact:
load
UniqueKeyfield,
Invoicedate,
....
from source QVD (Fact);
Max:
LOAD UniqueKeyfield, If (num(today()) - num(Max(Invoicedate)) > 60 , 'Dispatched' , 'Inprogress') as status
Resident Fact Group By UniqueKeyfield;
Thanks,
Deva
Looks good. However, you can simplify a bit removing formating function num() and ensure adding a group by clause since using max(), like:
Load
Dim1,
If (today() - Max(Invoicedate) > 60 , 'Dispatched' , 'Inprogress') as status
From <> Group By Dim1;
Hi,
you can try like this, if not working try to share your table structure with small mock date set ? tks
Fact:
load
UniqueKeyfield,
Invoicedate,
....
from source QVD (Fact);
Max:
LOAD UniqueKeyfield, If (num(today()) - num(Max(Invoicedate)) > 60 , 'Dispatched' , 'Inprogress') as status
Resident Fact Group By UniqueKeyfield;
Thanks,
Deva