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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
mikecrengland
Creator III
Creator III

Question on Rank()

Hello All -

I'm trying to create a fairly simple bar chart that ranks sales by customer. The expression is a simple sum of sales and I want the rank on the Axis.

For the Axis, I'm using

rank(Aggr(sum({<CompanyGroup = >}BilledAmount),CompanyGroup))

The expression for the bar is

sum({<CompanyGroup *= >}BilledAmount)

Which works until a company is selected I have the color set up to grey-out the unselected:

Capture.PNG

But the rank goes to 1 when a company is selected and I actually want it to keep its actual rank. I thought the {<CompanyGroup = >} would accomplish it, but no luck.

Any thoughts?

Thanks!

mike

1 Solution

Accepted Solutions
sunny_talwar

How about this:

Aggr(Rank(Sum({<CompanyGroup = >} BilledAmount)) * Avg(1), CompanyGroup))

View solution in original post

4 Replies
sunny_talwar

How about this:

Aggr(Rank(Sum({<CompanyGroup = >} BilledAmount)) * Avg(1), CompanyGroup))

mikecrengland
Creator III
Creator III
Author

You are da man! Worked like a charm.

vishsaggi
Champion III
Champion III

Hello Sunny,

Would you mind explaining this *Avg(1) what is this used for ??

Thanks,
V.

sunny_talwar

Was not 100% sure if it was needed or not, but just to be safe I added it