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

Using expressions in variables?

Hello

Lets say i have this expression

Sum(aggr(sum(amount),Date,Organization))

Can i then make a variable called vExpression1 = Sum(aggr(sum(amount),Date,Organization))

And then in my expression field for my chart or straight table just write vExpression1 ?

Ive tried but i cannot seem to get it to work

1 Solution

Accepted Solutions
Not applicable
Author

Solved it my self - A rookie mistake

Inserting the variable in qlikview without = does the trick and then referer to the variable by using $(variablename)

View solution in original post

5 Replies
v_iyyappan
Specialist
Specialist

Hi,

Try like that

var1 = Sum(aggr(sum(amount),Date,Organization))

expression like

= $(var1)

if u not get means please provide sample application.

regards,

Not applicable
Author

Sorry, cannot provide example..

tresesco
MVP
MVP

While defining the variable in variable overview window, if you put an '=' symbol and then the expression, then you can simply call the expression by simply putting =variable_name, otherwise put a '$' symbol like: =$(variable_name). This should work fine, if not, it would be something else(your dimension/expression ) rather than the variable expansion issue.

Not applicable
Author

Could you provide an qvw example?

Cause if i do like that, It does not work on aggr. Its like it does not aggr over my dates, but it takes in action which selections i have made.

Not applicable
Author

Solved it my self - A rookie mistake

Inserting the variable in qlikview without = does the trick and then referer to the variable by using $(variablename)