3 Replies Latest reply: Dec 12, 2016 2:19 AM by kiran ch

# How do I make a variable value constant, irrespective of chart selection

Hi all,

I have a calculated variable in my Qliksense Desktop (3.1) app that I wish to retain a constant. But right now, the value of this variable, which I have displayed in a KPI object, keeps changing based on my chart selections.

As an example, one of the variables is calculated as below :

vCount = (Count(if([Date] = MaxDate and ([Clinical Execution Time (latest)]-[Clinical Execution Time (prev)])>0, [Dataset Name])))

Please help.

Thanks,

Kanchana

• ###### Re: How do I make a variable value constant, irrespective of chart selection

Hi Kanchana, you can try with:

=Count({<[Date]={\$(=Max({1} [Date]))}, [Dataset Name]={"=Only({1} [Clinical Execution Time (latest)]-[Clinical Execution Time (prev)])>0"}>} [Dataset Name])

I'm using set analisys instead of If() to apply the filter. And using {1} to ignore selections.

• ###### Re: How do I make a variable value constant, irrespective of chart selection

Hi Ruben,

Thanks for your reply. But this looks complicated as I have several such calculations (even more complex ones) in my app. Would it be possible for you to show how I can convert this calculation to a set analysis expression and then use the constant setting?

Thanks,

Kanchana

• ###### Re: How do I make a variable value constant, irrespective of chart selection

Hi Kanchana,

Ruben has used set analysis and made the selections constant by using {1} in the set expression. I think you have to give a try