Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

kvijay173
New Contributor III

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...

Tags (1)
1 Solution

Accepted Solutions
Employee
Employee

Re: Variables not working in Qlik Sense

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)

1 Reply
Employee
Employee

Re: Variables not working in Qlik Sense

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)

Community Browser