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

Examples on new Aggr syntax

All,

Can any one post some examples on the new Aggr() syntax, especially on the sort able syntax.

5 Replies
vinieme12
Champion III
Champion III

Example scenario where you want to list top 5 countries in Sales in a Text box

Without Sort expression, the countries will be concatenated by load order.

Concat(AGGR(IF(Rank(sum(Sales),1,1)<=5, Country),Country),', ', )

With Sort expression, the countries will be concatenated in Order of RANK 1-5:

Concat(AGGR(IF(Rank(sum(Sales),1,1)<=5, Country),Country),', ', aggr(Rank(sum(Sales),1,1), Country))

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
maxgro
MVP
MVP

You can find an interesting examples here

Recipe for a Pareto Analysis – Revisited

Not applicable
Author

I saw that, but its not that much intuitive in a generic way. Thanks for the reply

gballester
Creator
Creator

I tried to use it in a simple example and it did not work for me. Do you have a simple example where you can apply?

In my case I used this syntax and it marks me as an error in the editor, when applying calculates but does not order.

=Aggr(SUM(TTRx),(TERRITORY_DESC,(=SUM(TTRx), DESC)))

gballester
Creator
Creator

a formula used is:

=Aggr(SUM(TTRx),(TERRITORY_DESC,(=SUM(TTRx),(numeric,DESCENDING))))