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

Announcements
Q&A with Qlik - Qlik Cloud Migration: Questions about migrating to Qlik Cloud? Catch the latest replay!
cancel
Showing results for 
Search instead for 
Did you mean: 
mohan2391
Creator III
Creator III

Previous Years data by selecting a Year

hi

I have a field like YEAR. By selecting a year in this field, I want to see the data corresponding to 5 years of data. I mean if I select 2015, I want to get data from 2010 to 2015 &if i select 2010 I need 2005 to 2010 data etc...

So how can i get that ?

What is the set expression for that ?

And where I have to mention it ?

Thank you

Labels (1)
10 Replies
mohan2391
Creator III
Creator III
Author

It is worked but a small correction. There is 1 extra closed bracket after 5. That's why i'm getting total sales till current year for every selection.

=sum({<Year={">=$(=Year-5)<=$(=Year)"}>}Sales)



Thank You..