Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Partner
Partner

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

0 Replies