Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, everyone.
Can you help with my problem? How to create a table which shows a ranking of certain company among other companies in different regions. For example:
Region | Sales | Sales_Company_A | Ranking_Company_A |
Region_A | 3 283 017 | 194 669 | 1 |
Region_B | 4 144 884 | 283 031 | 2 |
Region_C | 3 540 333 | 232 409 | 1 |
Region_D | 3 398 241 | 233 104 | 5 |
Region_E | 3 401 476 | 234 418 | 2 |
Region_F | 3 276 543 | 227 455 | 3 |
Region_G | 3 380 232 | 237 975 | 1 |
Region_H | 2 820 662 | 190 407 | 6 |
Best regards, Stark
May be like attached sample?
Hi Stark,
You can use rank() function. It might be of help to you.
Refer to Qlikview help for more details on this function.
Put this in expression window of straight table.
Rank(Sum(Sales_Company_A))
This will calculate top sales with by rank 1 , then 2,3, so on.
I try to use Rank(), but Rank(Sales) shows ranking of regions, aggr(rank(sum({<Vendor={"Company_A"}>} Sales),1,1),Vendor,Region) - return ranking of sales of Company_A in regions.
I need other result. For example:
There are 10 companies in Region_A and ranking of sales of Company_A is 1 in this region. Six companies in Region_B - ranking of Company_A is 2 in this region. Etc.
Thus, I want to get table that shows only ranking of sales of company A among other companies in every regions.
Best regards, Stark
May be like attached sample?
Thank you, Tresesco.
This is exactly what I need.
Best regards, Stark.
Hi Stark,
Take a look in the example.
I solved the problem combining the rank function with the aggr function.
I hope it can help you.
Regards.
Rodrigo Damas