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

Calculate regional ranks for selected client

Hi,

I am trying to build a straight table chart which will provide regional ranks for the selected client.

Please refer to attached example.. When a client (CMU2_NM) is selected, the revenue rank chart should show different ranks across each region (EXEC_REGION_L3_NM). For each region, selected CMU2_NM should be ranked among all other CMU2_NM based on revenue - sum(F_CV_YTD)

I am trying with below expression, which obviously does not work.. it seems to be ranking the selected client irrespective of region dimension and also the rank value is displayed against only one of the region.

=aggr(rank(sum({<CMU2_NM={"*"}>} F_CV_YTD),1,1),CMU2_NM)

Can someone please help in resolving this... thanks in advance!

2 Replies
Not applicable
Author

bump!

appreciate if someone can provide pointers to resolve this...

vgutkovsky
Master II
Master II

I've recently become quite annoyed at the inflexibility of the rank function. Specifically, I don't like that the total qualifier can't take the subtotal ( <> ) parameter. As a result, a UI-only solution would be quite complex and would require hardcoding your region into set analysis so that it would simulate a click. However, if your data model is really as simple as in your sample application, I would suggest precalculating a rank in the script. See attached for example of both solutions.

Regards,

Vlad