Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How do you use a variable in a variable?

Hi all,

Is it possible to use a variable in a variable in QlikView?

E.g. I have variable A and I need to use Variable A inside a Variable B!

6 Replies
Anonymous
Not applicable
Author

Yes, it's possible.

On Variable B expression, you can call variable A using $(VariableA).

Take a look on the attached file.

Regards,

Gabriel

jyothish8807
Master II
Master II

Hi Michael,

Its possible:

eg:

va1 =Sum(Sales)

Var2 =if(Year>='2013',$(va1),0)

Regards

KC

Best Regards,
KC
maxgro
MVP
MVP

1.png

Not applicable
Author

Hi ,

You can use any variable inside other variable.. by calling the variable with $ sign e.g. $(VariableA).

One more thing if your first variable is having aggregation formula in variable a then you have to put square bracket and call the variable e.g. [$(VariableA)]

Thanks

Not applicable
Author

you can use variable inside the variable

suppose set vA=10; set vB=20; and vC=$(vA)+$(vB);

then in text box $(vC) will reuslt 30

Not applicable
Author

Thank you so much guys! All your answers helped me understand it!