Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Highlighting top 3 values in a pivot

Hello

I need to highlight the highest 3 values in a column within a Pivot table.  I know how to do it based on Max and Min Value, but is there a way to do it with the Max3?  I have tried the following formula:

The below formula makes all of the cells red, not just the highest 3

If(Rank(Total Sum([Issue ID (Issue Inventory)])<= 3),RGB (255,0,0))

What am I doing wrong?

1 Solution

Accepted Solutions
sunny_talwar

Your expression will be

Count([Issue ID (Issue Inventory)])

Backgrond expression

If(Rank(Total Count([Issue ID (Issue Inventory)]))<4,RGB (255,0,0))

View solution in original post

8 Replies
sunny_talwar

Try this (you misplaced the closing parenthesis for Rank() function. It should be before the < sign and not after 3 (or 4 in my case):

If(Rank(Total Sum([Issue ID (Issue Inventory)])) < 4, RGB (255,0,0))

Not applicable
Author

Thank you, that helped a lot, but now I am not showing the top Values, I am not sure what the issue is now, any thoughts?

Formula:

If(Rank(Total Sum([Issue ID (Issue Inventory)]))<4,RGB (255,0,0))

This is what is happening with my data:

As you can see, the 395 should not be in red, it should be 510. 

sunny_talwar

Can you create another expression

Rank(Total Sum([Issue ID (Issue Inventory)]))

and check what rank is assigned to 510?

Not applicable
Author

sunny_talwar

I think your expression for Total is not this

Sum([Issue ID (Issue Inventory)])

If you want to rank Total, then use the exact expression you have within Total column

Rank(Total 'Change this to whatever you have under Total')

Not applicable
Author

Hi Sunny:

I have tried this:

=Rank(Count([Issue ID (Issue Inventory)]))

My original formula was:

Count([Issue ID (Issue Inventory)])

But now with the updated formula, I have gone from showing the total to showing the ranking.

I cant do a SUM on the field, since there are actual numbers, I need to do a count. 

This is what is happening to the column, with the new formula

sunny_talwar

Your expression will be

Count([Issue ID (Issue Inventory)])

Backgrond expression

If(Rank(Total Count([Issue ID (Issue Inventory)]))<4,RGB (255,0,0))

Not applicable
Author

That worked like a dream!  Thank you so much!!!