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

= in the expression

Hi ,

I have noticed the expression are prefixed with = symbol and some expressions are not prefixed with =. Is there will be any difference if we are using prefix = and not prefix =. Please suggest.

7 Replies
Miguel_Angel_Baeyens

Hi,

When you set an expression in the expression dialog box, then there is no need to use the "=" sign, as this is what QlikView is expecting. Setting the "=" before the actual expression will make no difference. But in some cases you want something to be evaluated as an expression, then you prefix it with the "=" sign.

For instance, say you want to display an expression in a text object, or within the caption of a chart, then you will need the "=" sign:

='Grand Total: ' & Sum(Amount)


You can check the expressions in the Settings menu, "Expression Overview" (NOTE: use this dialog with caution, since you can change expressions from here). You will see here a double == before those expressions that didn't need a preceding "=" but have one.

Hope that helps.

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi there,

Incidentally, there is a big difference between using the equals in front of expressions in variables. With an equals sign QlikView will re-evaluate the expression on any change (potentially a big resource drain) and using the variable will return the result of the expression. Without the equals sign the expression is not evaluated and the code is returned when the variable is used - this means it is evaluated where it is used.

The main visible difference of this is if an expression is used in a variable on a chart with a dimension. With an equals in front of the expression in the variable the same value will be returned for each dimension (as it is evaluated at application level), whereas if the variable does not have an euqals then it is evaluated separately for each dimension - thus giving a different answer.

Hope that makes sense.

Regards,
Steve

Miguel_Angel_Baeyens

Hello Steve,

Would you be so kind as to post some example caode of what you are explaining above? Do you mean that

$(vAggr)
would return something different than
=$(vAggr)
when vAggr has store
Sum(Value)
and is used in a chart expression?

Thanks

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Miguel,

What I was referring to is whether or not there is an equals sign in the variable rather than in the expression box.

I have put together an example document to show the difference in behaviour:

http://community.qlik.com/members/stevedark/files/Attached+Files/EqualsInVariables.qvw.aspx

Hope this clears up what I meant.

Regards,
Steve

Miguel_Angel_Baeyens

Hello Steve,

I was talking about different things. Now is crystal clear and your example very useful. I should add that I never create variables from the "Variable Overview" panel, since I usually want to assign some default values and I prefer to do that in the script.

Anyway, good point noting that and thanks for your example.

Not applicable
Author

Thanks Miguel A. Baeyens and Steve for providing high clarity on usage of the = symbol

kalyanamharish
Contributor III
Contributor III

Hi

Can you please explain with an Example QVW.  The link Given is not opening.