Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
kushalthakral
Creator III
Creator III

Difference between $(Variable) and $(=Variable)

Hi All

Just wanted to know what is the difference between $(Variable) and $(=Variable) while using them in Set Analysis

Thanks

Kushal Thakral

10 Replies
ramonarcusa36
Contributor III
Contributor III

Hi you all.

I find interesting what you say here, especially the part in which you say that the second approach makes the expression to be evaluated just once. That suggests we should do it that way, as far as performance is concerned.

I did a little testing. If the $(=variable) will make the variable to be evaluated first and then return its value to the expression, I guessed I would find differences if I do this:

MyVar: sum(Kilos) + sum(Euros)

Then I create a straight table with these two expressions:

Expression 1: $(MyVar) / 100

Expression 2: $(=MyVar) / 100

 

I would expect different results, since the first one should just expand the content of the variable and hence do something like sum(Kilos) + Sum(Euros) / 100 (for example 10 + 200 / 100 = 12), and the second one should calculate the sum first resulting in something like (10 + 200) / 100 = 2,1.

 

But the thing is both approaches behave the same way. It seems like both are expanding the content of the variable and doing something like 10 + 200 / 10 = 12. I never get the sum evaluated first.

 

Please see attached document.