Skip to main content
Showing results for 
Search instead for 
Did you mean: 

Ranking using more than 2 dimensions

Hi Everyone,

I am developing an app for a project that needs to use ranking in a straight table. The users want to show the top 5 products and an 'others' to show the rest. I tried to use first the dimension limitation available in qlik sense, but it usually shows more values and/or more dimensions than intended even if I have specified the rank function to return only 1 rank per row. so I used instead calculated dimensions.

Below is a sample what I wanted to return. I am able to correctly show the 1st and 2nd dimension(Product Name and Category) but I cannot return my intended values for the 3rd dimension(type). the 3rd dimension either returns only blanks, nulls, or shows other Product's not included in top 5. Using my example below, Products can have entries with different Category and/or different Type.

Product NameCategoryTypeValue
Product 1C1T11000
Product 2C1T2800
Product 3C3T3700
Product 4C2T4300
Product 5C1T1200


Below are the calculated dimensions I am using

Calculated DimensionsExpressionStatus
Product Nameaggr(if(rank(sum(Value)<6, [Product Name],'Others'),[Product Name])expected values returned
Categoryaggr(if(rank(sum(Value)<6, [Category],''),[Product Name])expected values returned
Typeaggr(if(rank(sum(Value)<6, [Type],''),[Product Name])expected values NOT returned


Greatly appreciate it for any inputs!

Thanks, wsc


0 Replies