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

max within set analysis

Hi

I have a field called financial year that will end up containing many years, however on one particular graph I only want to show the values relating to the most recent 2 years, I'm trying to do this with set analysis like:

=sum({<Financial_Year={$(max(Financial_Year)),$(max(Financial_Year)-1)}>} [Amount])

It says expression OK but the graph is empty?

Thanks.

2 Replies
Not applicable
Author

Try adding an equal sign into your dollar sign expansion:

=sum({<Financial_Year={$(=max(Financial_Year)),$(=max(Financial_Year)-1)}>} [Amount])


johnw
Champion III
Champion III

When trying to debug set analysis expressions with dollar sign expansions, I typically make a straight table with only that expression. You'll see the expression itself in the caption, and what got substituted for the dollar sign expansions in the column header. If nothing or something incorrect shows up for the dollar sign expansion, you know that's where the problem is. If I still can't see what's wrong, I may put the expression from the dollar sign expansion into a column of its own, and then play with it until I get it to produce the correct value, and then plug it back in to the main expression.