Qlik Community

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Customer & Partners, DEC. 9, 11 AM ET: Qlik Product & Strategy Roadmap Session: Data Analytics REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
hjm35055
Partner
Partner

SQL query - rolling 3 years

Hi

I am working in Qlik Sense and connected to a SQL database. Does anyone know what my where clause would be to bring in the previous 3 years based off of the field "oe-date-ent" (not shown)?

Thank you!

Screen Shot 2018-10-23 at 4.33.10 PM.png

2 Replies
achettipalli
Creator
Creator

Assuming your field "oe-date-ent" is a date column.

Let Vdatefilter=date(AddYears(today(),-3),'MM/dd/YYYY')   // you can use max(oe-date-ent) instead of Today() here,                                                                                                       //but you've to load it before the script.

Load

Field1,

field2...

from...

where oe-date-ent  >=$(Vdatefilter);

hjm35055
Partner
Partner
Author

The field oe-date-ent is being loaded in the script that I need to limit on the date so not sure that will work.