Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
MeeraAgrawal
Creator
Creator

Set Analysis Expression

Hi All,

I am new in Qlik sense . I want to assign variable name to measure like below expression but it's showing an error can you please help me this?

Revenue=Sum([Unit Sold])*sum([Price per unit])

Labels (2)
5 Replies
jwjackso
Specialist III
Specialist III

Within the script, you can define variables using Let  and Set  commands.

 

Let Revenue=Sum([Unit Sold])*sum([Price per unit]);

MeeraAgrawal
Creator
Creator
Author

Hi Jwjackso

Thanks for your prompt response, but it's showing an error please find the attached screen shot for your reference.

jwjackso
Specialist III
Specialist III

Use the Let command in the script, not the chart expression, to define the variable.  Then reference the variable in the chart.

MeeraAgrawal
Creator
Creator
Author

From where can I find script option to write that measure? Actually I don't have desktop edition so I m working as online ..please find attached reference screenshot

jwjackso
Specialist III
Specialist III

I see from your screenshot that you are using the Cloud version.  The script is accessed through the data editor, but you probably want to use the Variable  dialog.  Define the variable and then reference the $(variable name) in chart expressions.