Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
stark___
Contributor III
Contributor III

Ranking in straight rable

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:

RegionSalesSales_Company_ARanking_Company_A
Region_A3 283 017194 6691
Region_B4 144 884283 0312
Region_C3 540 333232 4091
Region_D3 398 241233 1045
Region_E3 401 476234 4182
Region_F3 276 543227 4553
Region_G3 380 232237 9751
Region_H2 820 662190 4076

Best regards, Stark

1 Solution

Accepted Solutions
tresesco
MVP
MVP

May be like attached sample?

View solution in original post

6 Replies
Not applicable

Hi Stark,

You can use rank() function. It might be of help to you.

Refer to Qlikview help for more details on this function.

Not applicable

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.

stark___
Contributor III
Contributor III
Author

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

tresesco
MVP
MVP

May be like attached sample?

stark___
Contributor III
Contributor III
Author

Thank you, Tresesco.

This is exactly what I need.

Best regards, Stark.

rodrigo_damas
Partner - Contributor II
Partner - Contributor II


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