Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I have a requirement where i have to display top 5 countries with maximum sales in qliksense text box. Not sales, but top 5 countries with sales. Is it possible using aggregate function in a single line?
Thanks in advance
Hi @niranjana
Try like below
=Concat(Aggr(If(Rank(Sum(Sales))<= 5, Country&'('&Sum(Sales)&')'), Country), ',', Aggr(Rank(Sum(Sales)), Country))
It will display Country & Sales with highest rank to lowest rank
Thanks a lot...it is working ..what if i want to show from 2nd like 2nd to 5th rank..excluding the first topmost country?
Hi @niranjana
In that case, change the if condition
=Concat(Aggr(If(Rank(Sum(Sales))>1 and Rank(Sum(Sales)) <=5, Country&'('&Sum(Sales)&')'), Country), ',', Aggr(Rank(Sum(Sales)), Country))