Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
pageomet
Contributor
Contributor

Rank with Ties in Bar Chart

I'm trying to create separate bar charts displaying TOP5 Damages by Area Description.   I'm experiencing an issue.  I use the calculated dimension, aggr(if(rank(sum([Dam Occur]))=1,[Area Description]),[Area Description]) for the first chart, aggr(if(rank(sum([Dam Occur]))=2 ,[Area Description]),[Area Description]), and so fourth.  With this function it orders the values in descending order, but I have multiple values that have the same total count, and the last four charts are blank.  How can create the charts even if the values are the same?

For instance:

Sum A = 10

Sum B = 8

Sum C = 6

Sum D = 2

Sum E = 2

Sum F = 2

Sum G = 2

1 Solution

Accepted Solutions
Josh_Good
Employee
Employee

Have you considered using the Dimension Limits function.  It is possible to simply enter show top x in the limits.  However if there is a tie then it will not display more than x.  You can make this expression more dynamic by testing how many members are in the top x.

For example the expression below will return the number of member which are in the top 5 including ties.  This expression can be used in the Dimension Limits tab so all the ties are included.

=len(concat(

KeepChar((aggr(rank(sum(Data),1,1),Member)),12345)

))

see the attached QVW for it in action.  Look at the Dimension Limits tab in the chart properties.

View solution in original post

1 Reply
Josh_Good
Employee
Employee

Have you considered using the Dimension Limits function.  It is possible to simply enter show top x in the limits.  However if there is a tie then it will not display more than x.  You can make this expression more dynamic by testing how many members are in the top x.

For example the expression below will return the number of member which are in the top 5 including ties.  This expression can be used in the Dimension Limits tab so all the ties are included.

=len(concat(

KeepChar((aggr(rank(sum(Data),1,1),Member)),12345)

))

see the attached QVW for it in action.  Look at the Dimension Limits tab in the chart properties.