
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Aggr and Rank
I am slightly confused with two expressions as they produce the same result even though they look different:
Expression 1: rank(aggr(sum(Sale),Item)) - This makes more sense to me as my understanding says aggr() creates a virtual table and then Rank() is performed on that
Expression 2: aggr(rank(sum(Sale)),Item) - It produces the same result as above but how it is working? I am bit confused as rank() is embedded in aggr(). Could you please help me understand?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You don't need Aggr here if you simple want Rank..
You can write
Rank(SUM(Sale),4)
But when you select Any single Item you will get Rank always 4.
So to get the Rank ignoring your Item selection, you can use below expression
Aggr(Num(Rank(Total Sum({<Item = >}Sale),4)),Item)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the pointers. I just finished reading them but still I am left with the same question...does the expression evaluation starts from within...that is rank(sum(Sale)) is computed first and then aggr() is performed on that...It looks like a dumb question but I am eager to learn it

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
these two expressions gives the same result but the right way is to use is
if(aggr(rank(sum(sales))>1,item),item)
