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: 
ayush
Contributor III
Contributor III

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 needwhat I needWhat I didWhat I did

Labels (1)
4 Replies
ArnadoSandoval
Specialist II
Specialist II

Hi @ayush 

You need to use these functions

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))

01.Countries-Colours.jpg

Hope this helps,

Arnaldo Sandoval
A journey of a thousand miles begins with a single step.
ayush
Contributor III
Contributor III
Author

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!

 

ayush
Contributor III
Contributor III
Author

++ I got the below colors but i see the Red is missing which shows the loss. I am using 

Query5.PNG

ArnadoSandoval
Specialist II
Specialist II

@ayush 

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

Arnaldo Sandoval
A journey of a thousand miles begins with a single step.