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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

variable in aggr

Hi,

I have an expression written in variable overview. I want to use this variable in 'calculated dimension' inside a chart.

For example, variable that I created: vSumOfAll = sum(x)+sum(y)

and I am using vSumOfall inside calculated dimension as :

rank(aggr($(vSumOfAll),[STATE]),4)

This shows an error. Any help on this is highly appreciated.

Regards.

1 Solution

Accepted Solutions
cesaraccardi
Specialist
Specialist

Hi

In order to use a calculated dimension you need to wrap-up the expression with an aggr function, try moving the position of the ranking function:

aggr(rank($(vSumOfAll),4),[STATE])

View solution in original post

3 Replies
cesaraccardi
Specialist
Specialist

Hi

In order to use a calculated dimension you need to wrap-up the expression with an aggr function, try moving the position of the ranking function:

aggr(rank($(vSumOfAll),4),[STATE])

Aurelien_Martinez
Partner - Specialist II
Partner - Specialist II

Hi,

If you do that :

aggr(rank($(vSumOfAll), 4), [STATE])

Aurélien

Help users find answers! Don't forget to mark a solution that worked for you!
Not applicable
Author

Thank you. It worked though it is difficult for me to understand why it worked this way. I thought rank was decided post aggregation and hence wrote the expression in that fashion. Thanks again..