Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
devarasu07
Master II
Master II

Concatenate top 5 Store

Hi All,

Using below expression able to get top selling store. but how to top 5 store ? any suggestion. Thanks

=Concat(DISTINCT Aggr(If(Sum(SoldQty) = Max(TOTAL <ArticleNo> Aggr(Sum(SoldQty), ArticleNo, StoreName)), StoreName), ArticleNo, StoreName), ', ')

Current Output,

Top 5 Store.jpg

Expected output like below,

Top 5 Store.jpg

Note:

tried like below and it's not working.

=if(aggr(rank(sum(SoldQty)),ArticleNo)<=5,

Concat(DISTINCT Aggr(If(Sum(SoldQty) = Max(TOTAL <ArticleNo> Aggr(Sum(SoldQty), ArticleNo, StoreName)), StoreName), ArticleNo, StoreName), ', ') )

Thanks,

Deva

1 Solution

Accepted Solutions
sunny_talwar

How about this:

=Concat(DISTINCT Aggr(If(Rank(Sum(SoldQty)) < 6, StoreName), ArticleNo, StoreName), ', ')

or

=Concat(DISTINCT Aggr(If(Sum(SoldQty) <= Max(TOTAL <ArticleNo> Aggr(Sum(SoldQty), ArticleNo, StoreName), 5), StoreName), ArticleNo, StoreName), ', ')

View solution in original post

2 Replies
sunny_talwar

How about this:

=Concat(DISTINCT Aggr(If(Rank(Sum(SoldQty)) < 6, StoreName), ArticleNo, StoreName), ', ')

or

=Concat(DISTINCT Aggr(If(Sum(SoldQty) <= Max(TOTAL <ArticleNo> Aggr(Sum(SoldQty), ArticleNo, StoreName), 5), StoreName), ArticleNo, StoreName), ', ')

devarasu07
Master II
Master II
Author

Hi Sunny,

Perfect working fine

Regards, Deva