Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to use let variable in front end? simple example pls?

how to use let variable in front end? simple example pls?

thanks

3 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

You can define a variable in the script or in the Variable Overview (from the Settings menu) in the front end. Once a variable is defined you can use it in expressions. An example:

Define a variable vToday that will contain the numeric value of todays date:

LET vToday = num(today());

Use the variable vToday in a set analysis expression to sum the sales of the last three months:

sum({<SalesDate={'>$(=addmonths($(vToday),-3))<=$(vToday)'}>} Sales)


talk is cheap, supply exceeds demand
Not applicable
Author

Hi Gysbert,

we  can call by setting variable by 'SET' as well but is there any advantage is there using ' LET' exactly here.

regards

Mahesh T

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

See this blog post: The Magic of Variables


talk is cheap, supply exceeds demand