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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Pie Chart Colour for Maximum Value

Hi

I have a pie chart which shows Sum(Revenue) by Sales Channel.

What I would like to show is for the slice with the largest Sum(Revenue) to be coloured in Green, whilst all other slices to be in grey.

May I know what kind of expression should I be using? I've tried colour mix and IF but they're not working.

Thanks in advance!

1 Solution

Accepted Solutions
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi

go to

  • your pie chart properties
  • colours and legend
    • toggle from "auto" to "custom"
    • choose by expression
    • put expression: If(Rank(aggr(sum(Revenue),[Sales Channel]))=1,RGB(0,255,0), RGB(150,150,150))
    • modify rgb colors according to your colour needs

thats it

cheers

Lech

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.

View solution in original post

5 Replies
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi

go to

  • your pie chart properties
  • colours and legend
    • toggle from "auto" to "custom"
    • choose by expression
    • put expression: If(Rank(aggr(sum(Revenue),[Sales Channel]))=1,RGB(0,255,0), RGB(150,150,150))
    • modify rgb colors according to your colour needs

thats it

cheers

Lech

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
Not applicable
Author

Cheers Lech

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

does it work for you mate?

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
Not applicable
Author

Works like a charm.

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

the only thing is that if there are null values in your dimension they will get a default "grey-ish" color.  I hope it is not a problem. Ultimately you may want to disable null values in dimension settings.

cheers

Lech

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.