Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Equal sign

Hello

I'm never quite sure when to use =, either when declaring a variable or in an expression.

Can someone please advise?

Thank you!

1 Reply
Jason_Michaelides
Luminary Alumni
Luminary Alumni

Hi,

Essentially, the equals sign will force the variable to be evaluated before passing to whatever expression you are using it in.  For example, say you had a variable vMaxSales.  If you put this in the variable settings:

Max(Sales)

and then in a text object put =vMaxSales, then you would get the actual words "Max(Sales)" returned.

However, if your variable had the equals sign:

=Max(Sales)

then your text object would return the evaluated expression (e.g. 4919).

You could also not use the equals sign in the variable, but instead force the variable to be evaluated in the epxression - so in your text box you could put:

=$(vMaxSales)

By using the dollar-sign expansion in the expression, it doesn't matter if there is an equals sign or not.

See attached,

Hope this helps,

Jason