Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
davidjlittlewood
Contributor
Contributor

Customer Sequential Colours In Map

I'm looking to create some custom colours based on % so if the 'Value' is less than or equal to 10% it would be 1 colour, if greater than 10% but less than 20% it would be another colour and so on until you get to greater than 90%.

I can do this when hardcoding the less than/ greater than to numbers but can't see how to do it by percentage.

Here's an example of the expression I'm trying to write:

If(Sum([Value]) <=10%, rgb(255, 255, 255), //White
If(Sum([Value]) >10% and Sum([Value]) <20%, rgb(140, 140, 140), //Gray
If(Sum([Value]) >20% and Sum([Value]) <30%,, rgb(191, 165, 84), //Brown
If(Sum([Value]) >30% and Sum([Value]) <40%, rgb(144, 205, 151), //Green
If(Sum([Value]) >40% and Sum([Value]) <50%, rgb(246, 170, 201), //Pink
If(Sum([Value]) >50% and Sum([Value]) <60%, rgb(136, 189, 230), //Blue
If(Sum([Value]) >60% and Sum([Value]) <70%, rgb(188, 153, 199), //Purple
If(Sum([Value]) >70% and Sum([Value]) <80%, rgb(237, 221, 70), //Yellow
If(Sum([Value]) >80% and Sum([Value]) <90%, rgb(240, 126, 110), //Red
If(Sum([Value]) >90%, rgb(251, 178, 88))))))))))) //Orange

Labels (2)
1 Reply
marcus_malinow
Partner - Specialist III
Partner - Specialist III

For a continuous colour range the ColorMix1 and ColorMix2 expressions are useful - https://help.qlik.com/en-US/qlikview/12.1/Subsystems/Client/Content/ChartFunctions/ColorFunctions/co...

In this instance, as you're wanting discrete bandings, I would round my colour expression to the nearest/lower 10% and then use Colormix1