
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
color change in map
Hi All,
I want to show countries on Map as per profit and condition is If profit is less than 0 red else green and the greater the profit the darker the green color and vice versa.
when i check qliksense map it has some 3-4 color to depict. PFA the attached pics.
Thankyou all
PS I need the one like in green.
what I need
What I did

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @ayush
You need to use these functions
- ColorMix2( <value>, <minimum-color>, <maximum-color>, <zero color> ) to create the gradient.
- Argb() to assign the colours required by the ColorMix2() function
- This Colour Picker page helps to select the appropriated values for the Argb() function.
- You may need the functions RangeMax() and RangeMin() to keep your Profit Percentage between -1 and 1, e.g. -100% and +100%
Now these are the steps to implement the colour feature in your map.
Expand the Layers > Countries (I assume that is the name of the dimension in your map) > Colors > Set it to Custom > Select by expression in the dropdown > enter your ColorMix2() function, mine looks like this:
ColorMix2( RangeMax(-1, (Sum(Sales) - Sum(Cost)) / Sum(Sales)),
Argb(255, 255, 0, 0),
Argb(255, 0, 153, 51),
Argb(255, 230, 255, 238))
Hope this helps,
A journey of a thousand miles begins with a single step.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thankyou for your reply.
I got the desired shades of colors but when I hover over a country I cant see the Sum(Profit) numeric value. how to get this? Any help is appreciated!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
++ I got the below colors but i see the Red is missing which shows the loss. I am using

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I usually help myself by adding a table with minimum to columns, the first for the countries and the second with the expression being used with the ColorMix2 function, so, when I was preparing my reply I had a table and its second column was the expression I posted above, e.g. You should do something similar; remember, the expression MUST return a percentage, e.g. values between -1 and 1, all the spectrum: -1, -0.9, -0.8 .... 0 ... 0.8, 0.9 and 1, so the idea of the table is assisting you to implement the ColorMix2 function and validate the results, you could even set the background colour
(Sum(Sales) - Sum(Cost)) / Sum(Sales)
hth
A journey of a thousand miles begins with a single step.
