Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
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