Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Obstacel
Contributor
Contributor

Finding the Rank of special value

Hi,

I have a problem with finding the rank of a special value.

I have a create a pivot table and I want to show the rank of a special product inside the dimension "Region" (see example below).

I have tried different things but I can't find a solution to show the right rank. So could you please help me?

Unfortunately loading the rank inside the script is not a good solution because of loosing the dynamic options.

Thank you very much.

 

Example for the raw data:

CountryRegionProductValue
GermanyNorthA100
GermanyNorthB50
GermanyNorthC20
GermanyEastA70
GermanyEastB60
GermanyEastC90
GermanySouthA20
GermanySouthB10
GermanySouthC80
GermanyWestA60
GermanyWestB40
GermanyWestC50

 

Pivot Table:

CountryRegionValueRank
Product C
GermanyNorth1703
 East2201
 South1101
 West1502

 

Labels (2)
1 Solution

Accepted Solutions
tresesco
MVP
MVP

Got it. It's a good one. 🙂

You can try something like:

how powerful aggr() is ! 😲

 

Aggr(IF(Product='C',Rank( Aggr(Value, Country,Region,Product))),Country,Region,Product) 

Capture.PNG

 

View solution in original post

6 Replies
anushree1
Specialist II
Specialist II

Not sure if this is what you are looking for..

Please check the attached.

Obstacel
Contributor
Contributor
Author

Thank your for your answer.

Unfortunately I'm using only QlikView and so I'm not able to open your attached file.

tresesco
MVP
MVP

How are East and South regions having same rank, i.e -1 ?

Obstacel
Contributor
Contributor
Author

Because "Product C" has in both regions the highest rank. In region "North" Product C has the 3rd highest rank and in "West" 2nd highest rank in comparison to the other products.

tresesco
MVP
MVP

Got it. It's a good one. 🙂

You can try something like:

how powerful aggr() is ! 😲

 

Aggr(IF(Product='C',Rank( Aggr(Value, Country,Region,Product))),Country,Region,Product) 

Capture.PNG

 

Obstacel
Contributor
Contributor
Author

Wow! Amazing...It's exactly the solution I was looking for.

Thank you very much...