Skip to main content

New to Qlik Sense

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

Announcements
Qlik Cloud Maintenance is scheduled between March 27-30. Visit Qlik Cloud Status page for more details.
cancel
Showing results for 
Search instead for 
Did you mean: 
fkeuroglian
Partner - Master
Partner - Master

Create variable in sense

Hi expert

I would like to create a variable like =date(firstworkdate (Max(Fecha), 1),'DD/MM/YY'), i have to create in  the script?

can i use this kind of function?

thank you a lot

Fernando

1 Solution

Accepted Solutions
sod
Employee
Employee

Hi Fernando,

Yes, you can create expression variables in the Qlik Sense script, and call them when needed.

Example:

SET vMeasure1 = date(firstworkdate (Max(Fecha), 1),'DD/MM/YY');

You can call this example variable by entering $(vMeasure1) as a new measure to any user interface object.  May I also make a suggestion that you can also fulfil this requirement by creating a Qlik Sense measure master item.  With this method, users can drag-and-drop the custom measure to any number of objects on the UI.  This method also avoids the need to memorize every measure variable during the development process.

Cheers,

Sean

View solution in original post

3 Replies
sod
Employee
Employee

Hi Fernando,

Yes, you can create expression variables in the Qlik Sense script, and call them when needed.

Example:

SET vMeasure1 = date(firstworkdate (Max(Fecha), 1),'DD/MM/YY');

You can call this example variable by entering $(vMeasure1) as a new measure to any user interface object.  May I also make a suggestion that you can also fulfil this requirement by creating a Qlik Sense measure master item.  With this method, users can drag-and-drop the custom measure to any number of objects on the UI.  This method also avoids the need to memorize every measure variable during the development process.

Cheers,

Sean

dineshsingh
Partner - Contributor III
Partner - Contributor III

,

Can we use LET instead of SET?

sod
Employee
Employee

Hi Dinesh,

Yes, LET commands can be used in the Qlik Sense script editor as well.