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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
donahuej
Contributor
Contributor

Display First Rank Only, in Chart

I have been using the following in a Text Object to display the first ranked "Project_ID" by a metric "Maximum Annual..." to great success:

=only(aggr(if(rank(sum([Maximum Annual Opportunity (from Benchmark)]),4)=1,Project_ID), Project_ID))

I also use this in other text objects on the same sheet, to display that same Project_ID's volume (which is just a count of account numbers) as seen below:

=only(aggr(if(rank(sum([Maximum Annual Opportunity (from Benchmark)]),4)=1,count(DISTINCT(Acct_Num))), Project_ID))

Unfortunately, I don't know how to get this to work within a chart. Here's the expression and screen shot:

Chart Type: Line Chart

Dimension: "Zero Balance Month"

Expression: =only(aggr(if(rank(sum([Maximum Annual Opportunity (from Benchmark)]),4)=1,count(DISTINCT(Acct_Num))), Project_ID))

Screenshot: attached

As you can see, it is calculating a value, which is equal to the total volume. But I want that volume by Zero Balance Month in this chart. Any ideas?

Labels (2)
1 Reply
Brett_Bleess
Former Employee
Former Employee

Jake, I would venture you are not getting much traction, as this one likely needs a QVW file for someone to be able to help better, as in general they will want to see the data model you have as well as the chart etc. in order to determine the proper make-up of the expression in the chart.  If you can attach a sample QVW with the gist of your situation that would work, but the actual app would be better.  If there is sensitive data in the app, you can use the Desktop Client Settings\Document Properties\Scrambling tab to scrambling sensitive fields, but be sure those are not a key to your expression etc., as that may make things a bit difficult to figure out...  

The only place I have otherwise is the following:

https://community.qlik.com/t5/Qlik-Design-Blog/Set-Analysis-in-the-Aggr-function/ba-p/1463822

https://community.qlik.com/t5/Qlik-Design-Blog/Pitfalls-of-the-Aggr-function/ba-p/1463275

There are some other hits on things, but I figured these may be the two best to start with, apologies if I have missed the gist of things.  My post will also kick things back up too, perhaps someone else will chime in as well.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.