Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
nagarwal
Partner - Contributor II
Partner - Contributor II

Bar Chart Dimension Limitation issue

Hello,

I am Facing an issue in Bar chart where I have Dimension, one Measure and one sorting Condition. 

now my requirement is that I need to sort using Sorting Condition and show only Top 5 records

but when I try to use dimension limit option here in Bar chart it actually get the Top 5 records of Measure.

Could anyone please help me out to get Top 5 Records on the basis on Sorting condition?

Thanks

 

1 Reply
abhishek2
Contributor III
Contributor III

Hi,

Create a counter column using your sorting condition in the script. Then use this counter column in a variable to sort the top 15.

Ex:  Autonumber(RowNo(), 'Sorting Column') as Counter

Then, create a variable:

let vTopN = 5;

Then in your measure expression:

Sum({<Counter = {"=$(vTopN)"}>}Measure

You can avoid the variable if you always need top 5 or can use it you want to make the selection dynamic using qsVariable.

 

Regards, Abhishek.