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: 
richnorris
Creator II
Creator II

Whats wrong with this set analysis?

I am trying to get the top ten clients for a given region, and use it as a dimension. So I have a calculated dimension which is the following:

=if(aggr(rank({<Region = {'EMEA'}>}sum([$(vCurrency) Volume])), [Sales Client]) <=10, [Sales Client])

However, it doesn't seem to make a difference what I change the 'EMEA' in my set analysis to, is there anything glaringly wrong to you more experienced types with what I'm doing here?

2 Replies
Miguel_Angel_Baeyens

Hello Rich,

I guess your set analysis should go in your sum expression

=if(aggr(rank(sum({< Region = 'EMEA' >} [$(vCurrency) Volume])), [Sales Client]) <= 10, [Sales Client])


Regards.

vgutkovsky
Master II
Master II

Yep, Rank does not take set analysis so you would need to either put it in your inner expression or put an IF statement on the outside.

Edit: Also, your AGGR should be on the outside and the IF should be on the inside: aggr(if(rank(sum(..))<=10,...),_____)

Regards,