Skip to main content
hic
Former Employee
Former Employee

In QlikView, as well as in Qlik Sense, there are numerous places where you can enter texts or expressions: In text objects, as measures in charts, as labels of objects, in variables, etc. If you start the text with an equals sign, this tells QlikView that “here comes a formula”. So, QlikView evaluates the string and calculates the expression instead of just treating it as a text constant.

 

Sometimes you must to use an equals sign, and sometimes not. But how can you know whether you must use an equals sign or not?

 

Basically, QlikView can interpret the text in two ways; either as a text (i.e. as a value) or as an expression. And what QlikView does by default varies from place to place.

 

In a chart measure (the expression), the text is interpreted as an expression. This means that you do not need an initial equals sign. It is OK to enter one anyway – it will not change the interpretation. This is an assignment by expression. This means that the value will be recalculated every time the user clicks. If you instead want to show the text as text, and not evaluate it, you need to enclose it in single quotes. There are many places in QlikView that behave this way: Measures, background colors, show conditions, calculation conditions, etc.

 

 

Image4.png

 

 

This is very different from e.g. QlikView Text boxes. Here, the text is interpreted as text. This is an assignment by value. This means that if you write an expression, it will not be evaluated unless it starts with an equals sign. Many places in QlikView behave this way: Text boxes, labels, Set statements, dollar expansions, etc. All places where it makes sense to use a plain text or a simple value behave this way.

 

 

Image6.png

 

 

Variables need a couple of extra words. Normally, you assign a variable by value; either in the script using a Set or Let statement, or in the user interface through an Input box or in document properties (Variables sheet).

 

 

Image7.png

 

 

An alternative is to use an assignment by expression. Then the value of the variable will be recalculated every time the user clicks, before it is used in other formulas. Just make sure that the little equals sign is there, and it will work.

 

 

Image8.png

 

 

Dollar expansions use exactly the same logic. If you have a dollar expansion without an equals sign, the enclosed text will be read as-is and used as a variable name. But if you instead use an equals sign, the enclosed text will be evaluated before it is expanded.

 

For example, assume that the variable vEndYear has the value of ‘2014’. Then

     $(vEndYear) will be expanded as ‘2014’

whereas

     $(=vEndYear-1) will be expanded as ‘2013’

 

Finally, a small word of warning: The initial equals sign means an extra calculation every time the user clicks. And every small calculation uses some CPU time and carries a small performance penalty. Hence, you should not use too many calculated expressions. Use them only in the cases where you really need them.

 

The little equals sign is your friend. Use it wisely.

 

HIC

 

Further reading related to this topic:

The Magic of Variables

The Magic of Dollar Expansions

16 Comments
hic
Former Employee
Former Employee

@ Juraj Mišina

You are right that there is an additional difference between different controls, and that is how they treat a dollar expansion. There are in fact three different control types:

Three control types.png

I'm not sure I like this behaviour either, but that is how it currently works.

HIC

0 Likes
4,766 Views
juraj_misina
Luminary Alumni
Luminary Alumni

Thank you Henric for clarifying this. After a short time I've got used to it, but every now and then when creating chart captions/titles it comes to my mind...

0 Likes
4,766 Views
mayankraoka
Specialist
Specialist

Thank you Henric for clarification.....

0 Likes
4,721 Views
NareshGuntur
Partner - Specialist
Partner - Specialist

Pardon me if it is too simply that I was unable to catch.

In QlikView, we have Dynamic Expression labels which I am unable to use in Qlik Sense.

For eg. "=ClientName" works fine in QlikView and shows the respective Client where as Qlik Sense is directly showing the text "=ClientName" rather than the value of ClientName variable.

Note: Double quotes are only to highlight the variable name. Double quotes are not used in the dashboard.

Cheers,

Naresh

0 Likes
4,721 Views
NareshGuntur
Partner - Specialist
Partner - Specialist

Anyone came across this kind of requirement?

0 Likes
4,721 Views
qlik4asif
Creator III
Creator III

now i am clear about equal sign, Thanks!!!!!!!!!

0 Likes
4,721 Views