Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Amelia_96
Contributor III
Contributor III

Filtering data based on current date and same period (before & after)

Hi, currently i'm doing dashboard that need to be updated everyday (morning).

My start date is 01/11/2020. But i need to have comparison between 'Before' & 'After'. So starting from 01/11/2020 up to current date (today=09/11/2020) will be 'After' (equivalent to 9days), and the same period for 'Before' (equivalent to 9days) will be from 23/10/2020 up to 31/10/2020.

Below are the sample expected output for each day when data is updated:

Amelia_96_0-1604916136221.png

Does anyone knows how do i write this in QlikView script to get this output when data is updated everyday?

Please help. Thank you in advance!

10 Replies
Frank_Kipry
Contributor II
Contributor II

I would try

table_new

NoConcatenate LOAD *, 

    if(Date < Date('01.11.2020'), 'Before', 'After') as Period

Resident table_old;

Drop Table table_old

 

With that you don't have to change your code, you just load the data from memory again, work with it and then drop the old stuff.

BUT, in general: don't use "Date" as field... since it's also a command, I would say that's bad programming style.