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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
konidena
Creator
Creator

Set Analysis

Hi Team,

I have a basic question. What is Set analysis?

Please provide me the exact definition of this. Is it the static selection or dynamic selection?

I have sales data of the years from 2011 to 2016.

I tried creating the pivot table with Product, Current Year sales and Previous Year sales.

Please find the attached qvw for better  understanding.

Question: if my selection is 2016 in the year field, then  i should get the 2015 as my previous sales data.

I am not able to write the expression for the previous year sales.

Please provide the set analysis expression for both current selection and current selection - 1.

4 Replies
konidena
Creator
Creator
Author

I have personal edition installed in my laptop. please copy the expression content here.

Appreciate your great help.

sunny_talwar

I think you were using Year, when your field name is year. QlikView is case sensitive so you need to use the right case. Try these:

sum({$<year={$(=max(year))}>}Sales)

=Sum ({$<year = {$(=Max(year)-1)} >} Sales)

konidena
Creator
Creator
Author

Thank you. It is working fine.

Now i want to display total years sales . When user selected any year, it should change. Is it possible?

sunny_talwar

May be this:

If(GetSelectedCount(year) > 0, sum({$<year={$(=max(year))}>}Sales), Sum(Sales))

What would the previous year sales show? 0?