Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

naming the expressions

I have some same expressions (i.e. facts) on different charts on differents sheets with different set of dimensions and they are pretty big. Is there any way to name them and use these names instead to keep the code simple.

I can't use variables as they store a single value.

Any suggetions are appreciated.

Thanks.

4 Replies
Anonymous
Not applicable
Author

In fact, variable can be anything, including expression as well.

Not applicable
Author

No the problem is , I have the aggregations in my expressions and if you store it in variables it gives you a same single value disregarding the dimensions if used on charts.

johnw
Champion III
Champion III

Either I'm not understanding the problem, or you're not understanding Michael's solution. Do something like this:

SET vAverage = avg(Value);

Then use this as your expression:

$(vAverage)

QlikView will substitute "avg(Value)", and thus calculate what you're looking for. It should take into account your chart dimensions just like anything else. Example attached.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP


Raj wrote:I can't use variables as they store a single value.


Raj,

The key to creating reusable expressions in variables is that the variable definition must not include the "=" sign.

-Rob