Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Ri_ta
Partner - Contributor II
Partner - Contributor II

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