Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Variable from complex calculation expression

hi i have the following calculation which i wish to transform into a variable;

sum([Förs pris] *  "Förs-kurs" * [Ursprungligt antal] * (1 + OrderRad_Rabatt) * (1+ OrderHuvud_Rabatt))

i have tried creating the variable but am unable to reuse it in any expression, have i done something wrong?

Best,

Brad

2 Replies
swuehl
MVP
MVP

There are differences in the way you create the variable, with or without an equal sign.

Please check

http://www.qlikfix.com/2011/06/08/not-all-variables-are-created-equal/

It also important, in which context you want to use the variable. Are you using it within an aggregation function like sum? If your variable expands to text, this will not work, since an aggregation function like your sum() is not allowed within another aggregation function without using advanced aggregation (i.e. the aggr() function).

calvindk
Creator III
Creator III

Did you try using Dollar sign expansion.

Your first test would be a straight table with no dimensions and your variable expression

$(vVariable)

In general i find that variables only work in some cases, while dollar sign expanded variables always works.

Best wishes