Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
devarasu07
Master II
Master II

Rank order with Concatenation?

Hi All,

Using below expression able to get top 5 Store Name in straight table, Is it possible to rank the store names according to highest sold/sales instead of alphabetical order? Thanks

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


Rank.JPG

Best Regards,

Deva

1 Solution

Accepted Solutions
antoniotiman
Master III
Master III

Hi,

try

=Concat(DISTINCT Aggr(If(Rank(Sum(SoldQty),4) <=5, StoreName), ArticleNo, StoreName), ', ',Aggr(-Sum(SoldQty),ArticleNo,StoreName))


Regards,

Antonio

View solution in original post

2 Replies
Not applicable

Hi,

For top 5 stores give 5 different expressions each one for first,second,third,4th and 5th shops.

for First store expression will be =Concat(DISTINCT Aggr(If(Rank(Sum(SoldQty),4) =1, StoreName), ArticleNo, StoreName))

2nd store =Concat(DISTINCT Aggr(If(Rank(Sum(SoldQty),4) =2, StoreName), ArticleNo, StoreName))

3rd store =Concat(DISTINCT Aggr(If(Rank(Sum(SoldQty),4) =3, StoreName), ArticleNo, StoreName))

4th store =Concat(DISTINCT Aggr(If(Rank(Sum(SoldQty),4) =4, StoreName), ArticleNo, StoreName))

5th store -=Concat(DISTINCT Aggr(If(Rank(Sum(SoldQty),4) =5, StoreName), ArticleNo, StoreName))

antoniotiman
Master III
Master III

Hi,

try

=Concat(DISTINCT Aggr(If(Rank(Sum(SoldQty),4) <=5, StoreName), ArticleNo, StoreName), ', ',Aggr(-Sum(SoldQty),ArticleNo,StoreName))


Regards,

Antonio