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.

Regards,

Brandon

2 Replies
Not applicable

Re: Can I make a variable the expression

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
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:

Sum(Sales)

in the expression:

=$(vSum)

Greetings from Munich

Martina

Community Browser