Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

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

Tags (3)
1 Solution

Accepted Solutions
Not applicable

Re: Using expressions in variables?

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)

5 Replies
v_iyyappan
Valued Contributor

Re: Using expressions in variables?

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

Re: Using expressions in variables?

Sorry, cannot provide example..

MVP
MVP

Re: Using expressions in variables?

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

Re: Using expressions in variables?

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

Re: Using expressions in variables?

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)

Community Browser