3 Replies Latest reply: Oct 6, 2016 12:26 PM by Sunny Talwar

# 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!

• ###### Re: Set analysis - year -1 for all selections

May be like this:

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

• ###### Re: Set analysis - year -1 for all selections

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).

• ###### Re: Set analysis - year -1 for all selections

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

The As-Of Table