Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

rittermd
Honored Contributor

variable in Qlik Sense

I created a variable in the app (not the script) to display a count of a certain type record.

The formula editor says that the expression is ok.

However, I can't get anything to display. 

The variable is called vHomeCount and the expression is

If (DestName=('Home'), Count(DISCHARGE_DESTINATION))

I tried to display in a text object and a KPI and neither displays a result.

I remember in QV you had to put a $ in front of it. 

Any assistance would be greatly appreciated.

3 Replies

Re: variable in Qlik Sense

Yup, you need to dollar expand it in the Text Object like this :

     $(vHomeCount)

Here is a good Blog Post about Dollar Expansion

     The Magic of Dollar Expansions

rittermd
Honored Contributor

Re: variable in Qlik Sense

I tried that and I get nothing but a - displayed in the text object

rittermd
Honored Contributor

Re: variable in Qlik Sense

I modified the variable expression and took out the If and replaced with set analysis and now it returns the correct value.