Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set analysis - year -1 for all selections

Hi All,

I'm trying to reach the following result with set analyais:

For each year year chosen (not max year) show data for previous year. So:

If 2015 is chosen - show data for 2014.

If 2015 and 2016 are chosen show data for 2014 and and 2015.

If none is selected (so all the years are chosen by default) - show data for year-1 of all the years.

How can that be done?

(The needed solution is more complex but that would be a good start).

Thanks!

3 Replies
sunny_talwar

May be like this:

Sum({<Year = {"$(='>=' & Min(Year)-1 & '<=' & Max(Year)-1)"}>}Sales)

Not applicable
Author

Thanks, but that will not solve a situation when the selected years are not subsequent.

For example: if 2013 and 2016 are chosen I need the data for 2012 and 2015 (the set analysis above will bring 2012, 2013, 2014, 2015).

sunny_talwar

In that case, you can use the approach specified here:

The As-Of Table