Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
smilingjohn
Specialist
Specialist

script

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

1 Solution

Accepted Solutions
devarasu07
Master II
Master II

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

View solution in original post

2 Replies
tresesco
MVP
MVP

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;

devarasu07
Master II
Master II

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