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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set analysis and Dollar-Sign Expansion

Experts,

I am trying to get the latest month number for current selection using following expression:

=Sum({$<monthyear={$(=Max(monthyear))}>} amount)

but it returns NULL values.

Then I tested it using a string instead of Dollar-Sign Expansion. it does work

=Sum({$<monthyear={'Jun-2009'}>} amount)

The Format of 'monthyear' is MMM-YYYY

Does anyone know what is wrong with 1st expression and how to get it to work.

Many thanks

1 Solution

Accepted Solutions
Not applicable
Author

try this:


=Sum({$<monthyear={'$(=Max(monthyear))'}>} amount)


note the little ' if you can't see it in the code. Conversely, you could make declare Max(MonthYear) a variable and the set analysis syntax would be less complicated??

View solution in original post

2 Replies
Not applicable
Author

try this:


=Sum({$<monthyear={'$(=Max(monthyear))'}>} amount)


note the little ' if you can't see it in the code. Conversely, you could make declare Max(MonthYear) a variable and the set analysis syntax would be less complicated??

Not applicable
Author

adding ' works. Using variable gives right results as well.


Thanks a lot for this