Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
devan9876
Creator
Creator

Nested Variables in Aggr

I have a chart with one calculated dimension and one expression.The vTest variable is used as a parameter for the vRank Variable and an integer is passed in as a parameter to the vTest variable.  

This is what I have for my formulas and it returns  "//Error in calculated dimension".

Chart:

Dimension:Aggr($(vRank($(vTest(12)))),GROUP)

Expression: count(distinct GROUP)

 

Variable Definitions:

vTest: Sum({<TYPE={$1},INDEX={1}>}QTY)/Sum({<TYPE={$1},INDEX={1,2}>}QTY)

vRank: if($1>=.9 and $1<=1,1,
if($1>=.7 and $1<=.8999,2,
3))

 

 

12 Replies
devan9876
Creator
Creator
Author

Does pick/match outperform nested ifs enough that it would justify doing that?

devan9876
Creator
Creator
Author

Does pick match outperform nested ifs enough that it would justify doing that?

marcus_sommer

Usually performed pick(match()) better as nested if-loops because the expression is only evaluated ones and then compared against the value-list. By if() will be at first all branches evaluated and in a second step followed the comparing - that's different to many other tools and an intended design decision.

- Marcus