Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Please help with below query.
Country Product Sales
USA Motors 500
USA Spare 500
USA Keys 300
USA Tyres 200
USA Soaps 600
IND Soaps 300
IND Micher 200
IND Spare 500
IND Keys 400
UK Raw Parts 400
You'll need the rank function.
Rank(Sum(Sales), 4) <= 3
For the value of the top 3 products in each country, you can work with the total() qualifier and the aggr().
Sum(Sales)
/
Sum(TOTAL <Country>aggr(If(Rank(Sum(Sales), 4) <= 3, Sum(Sales)),Country, Product))
- Matheus
You'll need the rank function.
Rank(Sum(Sales), 4) <= 3
For the value of the top 3 products in each country, you can work with the total() qualifier and the aggr().
Sum(Sales)
/
Sum(TOTAL <Country>aggr(If(Rank(Sum(Sales), 4) <= 3, Sum(Sales)),Country, Product))
- Matheus
Today is my lucky day! Every question I read, is covered as an exercise in my Qlik Expert class, or in my Advanced Development Techniques session at the Masters Summit for Qlik 🤣🤣🤣
To show top 3 products for each Country, I'd recommend the following calculated Dimension for the Product:
AGGR(IF(Rank(sum(Sales), 4) <= 3, Product), Country, Product)
Cheers,
Oleg Troyansky