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

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
qfattah
Contributor II
Contributor II

Limit Records to Top 5 Based on Rank in Multiple Vertical Dimensions Table

I have a simple table that has 4 dimensions and a Rank function that is simply "Rank(TOTAL MASTER_MEASURE)". How do I get QLIK to show me the top 5 records only? 

 

Sample output table: 

Dim1  Dim2 Dim3 Dim4 Dim5 Rank

Record 1   x x x x          1                                     

Record 2   x x x x          2                                     

Record 2   x x x x          3                                     

Record 2   x x x x          4

Record 2   x x x x          5                                                                          

Labels (1)
4 Replies
rdm6532
Contributor III
Contributor III

Hello there, in a table, you should be able to show only the Top  5 records using the 'Limitation' feature on the first dimension in the table. You may need to activate the same Limitation on the other Dimensions too. 

rdm6532_0-1744117929281.png

 

Chanty4u
MVP
MVP

Try this 

IF(Rank(TOTAL MASTER_MEASURE) <= 5, Dim1)

 

qfattah
Contributor II
Contributor II
Author

I tried this one, but for some reason it still shows all the records and doesn't limit it to 5. 
My master measure is basically ({<DIM= {'1'}>} Count(DISTINCT DIM1&DIM2)) / (SUM(MEASURE)/1000)) - SUM(MEASURE)) but I'm not sure that would be a reason for Qlik to ignore the top 5 limit I add. 

 

I also made sure the top 5 limit is added to all the dimensions, but that still didn't help. I have found success with this method earlier but it's failing me now. 

qfattah
Contributor II
Contributor II
Author

I tried this and it returned "Invalid Dimension" for some reason! I thought maybe I need to apply the formula to all my dimensions to ensure the table is aligned, but for that didn't work either. I dropped screenshots of my formulas. 

 

Have you encountered this before?