Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Qlik Highlights 2020 Giveaway! Watch, reply and have a chance to win a $200 Amazon Gift Card! Watch Video
Showing results for 
Search instead for 
Did you mean: 
Creator II
Creator II

How to reuse LET/SET variables to (re)calculate on the backend?

Hi Community! 


Is it possible to reuse LET/SET variables on the backend to (re)calculate and use the results again as new LET/SET variables? 




LET  vVariable1 = 1+1  ;
LET vVariable2 = 3+3; 

LET vTotal = $(vVariable1) + $(vVariable2)  


LET vTotal = vVariable1 + vVariable2


LET vTotal = $(vVariable1 + vVariable2)

I have tried the 3 options and have expected to get 8, however I'm getting an error on the frontend. 


Could someone please help? Thanks in advance! 

Labels (2)
5 Replies

What is the error?

These statements are all legal, except the last. Did you include semi-colons at the end of

LET vTotal = $(vVariable1) + $(vVariable2);
LET vTotal = vVariable1 + vVariable2;

I prefer the latter myself as the expansion is not necessary here.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Creator II
Creator II

Thanks for the reply. hmm wierd, I have tried both but still getting null as error even though my data has values. I'll check it further.
Creator II
Creator II

I'm getting null even though my values are filled 😞

Working for me:

Variable in Script.PNG