Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

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.



2 Replies
Not applicable

Re: Can I make a variable the expression


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


Valued Contributor II

Re: Can I make a variable the expression

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:


in the expression:


Greetings from Munich


Community Browser