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

Announcements
April 13–15 - Dare to Unleash a New Professional You at Qlik Connect 2026: Register Now!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Ranking in a line chart

I am having a problem with ranking in a line chart.  One chart uses this dimension:

=aggr(
if(
rank(
Sum ({$<[As of Date] = {'12/31/2011'}>}
[ICC Counter])) <= 5
  , [Insurance Company Name])
  , [Insurance Company Name])

and it works fine.  It displays the top 5 Companies.

The second chart is exactly the same as the first except it is looking for Companies 6-10 (I am only displaying 5 lines).

=aggr(
if(
rank(
Sum ({$<[As of Date] = {'12/31/2011'}>}
[ICC Counter])) >= 6
  , [Insurance Company Name])
  , [Insurance Company Name])

The result I am getting is the bottom 5 Companies.

If I change the expression to:

=aggr(
if(
rank(
Sum ({$<[As of Date] = {'12/31/2011'}>}
[ICC Counter])) = 6
  , [Insurance Company Name])
  , [Insurance Company Name])

I get the # 6 Company

1 Solution

Accepted Solutions
pover
Partner - Master
Partner - Master

You should be able to get the result you're looking for if you sort by the expression Sum ({$<[As of Date] = {'12/31/2011'}>} [ICC Counter]) in the line chart in descending order or include in your if-statement the condition that the rank is less than or equal to 10 along with being greater than or equal to 6.

Karl

View solution in original post

1 Reply
pover
Partner - Master
Partner - Master

You should be able to get the result you're looking for if you sort by the expression Sum ({$<[As of Date] = {'12/31/2011'}>} [ICC Counter]) in the line chart in descending order or include in your if-statement the condition that the rank is less than or equal to 10 along with being greater than or equal to 6.

Karl