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: 
Ri_ta
Partner - Contributor III
Partner - Contributor III

Sense: Using a variable in set analysis

Hey guys,

I have two variables in my script:

LET vYearMonthCurrent = '=Max(YearMonth)';
LET vYearMonthPrevious = '=Date(Addyears(Max(Id_Date), -1), '&chr(39)&'YYYY-MMM'&chr(39)&')';

And I'm using the first one in a graph in set analysis in this expression:

SUM ({<YearMonth= {"$(vYearMonthCurrent)"} >}VALUE)
+
SUM ({<YearMonth= {"$(vYearMonthCurrent)"} >}VALUE_AC)

It works just fine.

But if I want to use the variable with the previous year&month and do this:

SUM ({<YearMonth= {"$(vYearMonthPrevious )"} >}VALUE)
+
SUM ({<YearMonth= {"$(vYearMonthPrevious )"} >}VALUE_AC)

It shows 0.

Do you know why this happens?

 

Thanks,

 

Rita

Labels (3)
0 Replies