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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set analysis - Orders of sets

Hi all,

when we do selections in the listboxes, due to the way you design the data layer, other fields can result in having some values grayed-out so the user usually selects only the available ones.

I need to apply this idea to two sets of a set analysis expression. Let's say I have the below table:

YearSemesterUnits
2012130
2012210
2013120

if I do the following set analysis

sum({$<Year = {"$(=max(Year))"}, Semester = {"$(=max(Semester))"}>}Units)

I get 0 because it is trying to do Year = 2013, Semester = 2. Obviously I would like to get 20 (Year = 2013, Semester = 1).

Is this possible? If yes, how?

Thank you so much.

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try:

sum({$<Year = {"$(=max(Year))"}, Semester = {"$(=max({$<Year = {"$(=max(Year))"}>} Semester))"}>}Units)


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try:

sum({$<Year = {"$(=max(Year))"}, Semester = {"$(=max({$<Year = {"$(=max(Year))"}>} Semester))"}>}Units)


talk is cheap, supply exceeds demand
Not applicable
Author

It seems working! Thank you!