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: 
Anonymous
Not applicable

Set Analysis with Chart Dimension

I understand that Set analysis is calculated only once per chart and not row by row. Is the only option to solve this; is by using an IF statement?

I have a sample application attached wherein I have used an IF statement but I do not get the right output. Can someone point me the right direction?

I want to calculate the difference in Sales over the Years. I dont want to use the ABOVE function. Wanted to see how it can done with IF statement. See the sample application attached.

3 Replies
robert_mika
Master III
Master III

Try:

=sum({$<Year={$(=max(Year))}>}Sales)-sum({$<Year={$(=max(Year)-1)}>}Sales)

Anonymous
Not applicable
Author

I want the answer to be

Year      Difference in Sales

1998     -58

1999      47

which I could get using Sum(Sales) - above(Sum(Sales)) with Year as dimension. Is there anyway to do it with IF statement and set analysis.

robert_mika
Master III
Master III

Above is designed to do that so I do not think there is a way but I maybe wrong and someone else has the answer.