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

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using set analysis to get Max Value regardless of selection

Hello!

I'm trying to compare Prior Year and Current year, so what I'm doing is grabbing the current [Year Month] selection, subtracting it by 100

and using set analysis to force it onto the expression:

=num(sum({<[Year Month] =  {$(=v_MaxYearMonth-100)}, [Type] = {'P'}>}[Count]),'#,##0')

I have set as v_MaxYearMonth =Max({1}[Year Month])

I verified that v_MaxYearMonth works, but the sum expression does not for all [Year Month] selections, it returns the sum only if the selection is 201305 (which incidentally is this 201405 - 100), but returns 0 otherwise

Maybe I'm missing something obvious, but I've been pondering on this for hours, and I got nothing...

Any ideas?!

10 Replies
Not applicable
Author

BINGO!!! you got it!!! thank you Jagan Mohan

FYI: I just set the Year to -1 as per your first suggestion