Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

set variable

Hello,

I would like to set a variable in expression :

Expression :

sum({$<Round={'6'}>} Points)


instead of 6 the variable should be : vLast

vLast = Max({$<Played={'1'}>} Round)
I put it in a script (also tried in Variable overview)
SET vLast = Max({$<Played={'1'}>} Round).

but when I put
sum({$<Round={vLast}>} Points)
the expression is not working.
Separately expressions sum({$<Round={'6'}>} Points) and Max({$<Played={'1'}>} Round) are working.

Can somebody have any idea ?

Best thanks in advanced,

12 Replies
Gabriel
Partner - Specialist III
Partner - Specialist III

Hi,

The main issue with your variable is you're passing integer as strings using double quote.

If you remove the double quote from you integer your variables should work.

SET vLast = Max({$<Played={1}>} Round);

//Max({$<Played={1}>} Round) this is from variable overview

sunilkumarqv
Specialist II
Specialist II

This works

sum({<Round={'$(=$(vLast))'}>}Points)

Not applicable
Author

Thank you all !!