Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
manozpph
Creator
Creator

What is the difference between using “=” before a variable and when it is not used?

Hey Guys Can Some body Let me know the Answer for this Question.

What is the difference between using “=” before a variable and when it is not used?

Thanks In Advance!

1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

Hi,

Giving = in variable will evaluate the expression and stores the result in variable, if we do not give = then the expression is stored as string.

For example:

vSales : =Sum(Sales) - then Total sales is calculated (Assume total sales is 1 Million)

vSalesExpression : Sum(Sales) - this will store Sum(Sales) as string

Now in a chart if you have a dimension Customer and use the above expression

=$(vSales) - for all the customers you will the same sales amount 1 Million, since it is already evaluated.

=$(vSalesExpression ) - will calculate the sales for each customer, $(vSalesExpression ) will simply put Sum(Sales).

Hope this helps you.

Regards,

Jagan.

View solution in original post

3 Replies
jagan
Luminary Alumni
Luminary Alumni

Hi,

Giving = in variable will evaluate the expression and stores the result in variable, if we do not give = then the expression is stored as string.

For example:

vSales : =Sum(Sales) - then Total sales is calculated (Assume total sales is 1 Million)

vSalesExpression : Sum(Sales) - this will store Sum(Sales) as string

Now in a chart if you have a dimension Customer and use the above expression

=$(vSales) - for all the customers you will the same sales amount 1 Million, since it is already evaluated.

=$(vSalesExpression ) - will calculate the sales for each customer, $(vSalesExpression ) will simply put Sum(Sales).

Hope this helps you.

Regards,

Jagan.

jagan
Luminary Alumni
Luminary Alumni

manozpph
Creator
Creator
Author

I have gotten the Answer.

Thank you so much for your help.