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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Dolly123
Creator II
Creator II

where condition ?

Extract data for 2 years data in qliksense using where condition in code.

4 Replies
Prem0212
Creator
Creator

you can use the where condition like this in the Data load editor

WHERE [date field] >= 'start date' and [date field] <= 'end date';

Prem0212
Creator
Creator

You can also use this condition and it will extract the data for past 2 years from now

WHERE [Ship Date] >= YearStart(AddYears(Today(), -2)) and [Ship Date] <= Today();

MayilVahanan

Hi

Try like below

Where Year(DateField) >= Year(Today())-2;

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
BrunPierre
Partner - Master II
Partner - Master II

These are for dynamic loading.

Current year to next 2 years

 Where Year(DateField) >= Year(Today()) and Year(DateField) <= Year(Addyears(Today(),2));

From the last 2 years to the current year

 Where Year(DateField) >= Year(Addyears(Today(),-2)) and Year(DateField) <= Year(Today());