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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Can I make a variable the expression

Hi community,

I was wondering if it would be possible to make a variable an expression i.e. write the expression in the variable field and have the variable as the definition for the expression.

I want to make buttons that change the variable which shows up in the line graph.

Regards,

Brandon

2 Replies
Not applicable
Author

Hi,

i did it once defining the variable from Variable Overview (setting menu) .

I added a new variable vYearSelected and defined as =If(GetPossibleCount([Year])=1,[Year],max([Year])).

Everytime i change the Year selection, the variable change value automatically.

I think that you can do that also in script using the SET command

like this

SET vYearSelected ='=If(GetPossibleCount([Year])=1,[Year],max([Year]))';

but i never tested it

Alessio

brenner_martina
Partner - Specialist II
Partner - Specialist II

Hi Brandon,

of course you can do this:

SET vSum = 'Sum(Sales)'; (in script)

or define them in the variablelist in settings only the text:

Sum(Sales)

in the expression:

=$(vSum)

Greetings from Munich

Martina