Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Variables not working in Qlik Sense

I am creating a chart to show the count of products in Qlik Sense.

I have set up the variable in the script editor as LET vMonthPrevious = MonthName(Today())-1;

In the chart - Dimension is Products and expression is Count({<Month={$(vMonthPrevious)}>}Products)

The result is a blank chart.. Can someone help me...

1 Solution

Accepted Solutions
JonnyPoole
Employee
Employee

hi there,

try using 'SET'

SET  vMonthPrevious = MonthName(Today())-1;


also put $(vMonthPrevious) in a text/image object just to be sure its calculating the result in right format.


Even after using SET and reloading, you may still need some adjustments or interpretation/formatting functions to get the equivalence operation in the SET to work as you need.


Count({<Month={'$(vMonthPrevious)'}>}Products)

View solution in original post

1 Reply
JonnyPoole
Employee
Employee

hi there,

try using 'SET'

SET  vMonthPrevious = MonthName(Today())-1;


also put $(vMonthPrevious) in a text/image object just to be sure its calculating the result in right format.


Even after using SET and reloading, you may still need some adjustments or interpretation/formatting functions to get the equivalence operation in the SET to work as you need.


Count({<Month={'$(vMonthPrevious)'}>}Products)