Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
HigorFreitas
Contributor
Contributor

Creating a Variable 1+1

Hello There!

I'm a newbie in Qlik Sense, and I need help to create a variable that's the result of an expression (1+1) in my app.

How can I create this?

 

Thanks!

Labels (3)
2 Solutions

Accepted Solutions
rafatashiro
Contributor III
Contributor III

Hello Higor!

 

You have 2 ways to do this:

  • In script you can use LET to create a variable that  results in a expression result
  • In variable manager (in botton left corner) you can create a variable using equal simbol (=) in the beggining of your expression

 

Hope it helps! 😁

Best Regards 

View solution in original post

Lokesh_5045
Creator
Creator

Data Load Editor:
Let vSum = 1 + 1; (in the data load editor)
Now we can use $(vSum) expansion to pass the value of variable.

Front end:

Lokesh_5045_1-1671114239654.png

 

On left - bottom corner, you can create variables. For reference

Lokesh_5045_2-1671114459896.png


Once you create them, they appear like below.

Lokesh_5045_3-1671114519381.png

vSum is created in Data load editor and cannot be edited/deleted from Front-end.
vSumm is created in Front-end. Can be edited or deleted.

One more way to create a variable which stores as string.

Set vString = 1+1;
It doesn't give result as 2. It gives result as '1+1'.

View solution in original post

3 Replies
lrenwick
Contributor III
Contributor III

Hi!

 

I posted a similar solution yesterday https://community.qlik.com/t5/New-to-Qlik-Sense/Assigning-a-list-to-a-variable/m-p/2016082#M220092

You'd need to create sum(1+1) as the variale and then use $() around the variable name to execute it

 

 

rafatashiro
Contributor III
Contributor III

Hello Higor!

 

You have 2 ways to do this:

  • In script you can use LET to create a variable that  results in a expression result
  • In variable manager (in botton left corner) you can create a variable using equal simbol (=) in the beggining of your expression

 

Hope it helps! 😁

Best Regards 

Lokesh_5045
Creator
Creator

Data Load Editor:
Let vSum = 1 + 1; (in the data load editor)
Now we can use $(vSum) expansion to pass the value of variable.

Front end:

Lokesh_5045_1-1671114239654.png

 

On left - bottom corner, you can create variables. For reference

Lokesh_5045_2-1671114459896.png


Once you create them, they appear like below.

Lokesh_5045_3-1671114519381.png

vSum is created in Data load editor and cannot be edited/deleted from Front-end.
vSumm is created in Front-end. Can be edited or deleted.

One more way to create a variable which stores as string.

Set vString = 1+1;
It doesn't give result as 2. It gives result as '1+1'.