Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join this live chat April 6, 10AM EST - QlikView to Qlik Sense REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
shmpradeep
Contributor II
Contributor II

Loading selective data based on period

Hi ,

I have source data which is like

MAY-2018,1,2,3,4

APR-2018,1,2,3,4

DEC-2017,1,2,3,4

If current month is JULY-2018 then I want to avoid loading data older than 6+1 month hence in the loading I want to avoid loading DEC-2017 entry.

thanks,

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Where Date#(Date,'MMM-YYYY') >= AddMonths(Today(),-7);

View solution in original post

6 Replies
olivierrobin
Specialist III
Specialist III

hello

try something like

let a=date(today(),'MMM-YYYY');

let b=date(addmonths(a,-6),'MMM-YYYY');

and in you load, add a where clause

DateLoad>=b;

shmpradeep
Contributor II
Contributor II
Author

Hi, Does it not require to convert the first column to the date format? Because I already tried the above method but it is loading 0 rows i.e. nothing.

shmpradeep
Contributor II
Contributor II
Author

I did try something like below in the where clause but it didn't work.

Where Date(MONTH&'-'&YEAR,'MMM-YYYY') >= date(AddMonths(Today(), -7),'MMM-YYYY');

sergio0592
Specialist III
Specialist III

Try with :

Where Date(Date#(MONTH&'-'&YEAR,'MMM-YYYY')) >= AddMonths(Today(),-7) ;

tresesco
MVP
MVP

Where Date#(Date,'MMM-YYYY') >= AddMonths(Today(),-7);

View solution in original post

shmpradeep
Contributor II
Contributor II
Author

both solutions are working.