Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
PamelaAlcantara
Contributor II
Contributor II

Geo Maps Color by expression is not working

Hi all,

I am having a issue while trying to establish a color by expression on a chart layer.  Every time the number of items is bigger than 1, the color is gray.

Dimension = Country

Slice = Rank 

Measure: # Items

If I use the color by dimension (Slice) I get the correct visualization with the Qlik Sense default colors. When I try to use the color by expression:

=if( Rank<=20, 'green', if (Rank>20 and Rank<=40, 'yellow', if (Rank>40, 'red')))

The expression work but only when the #Items = 1, as soon as I get more than one, the color goes to gray.

 

GeoMap.jpg

 

Does anyone know how to solve this issue?

Thank you,

Pamela

1 Reply
fosuzuki
Partner - Specialist III
Partner - Specialist III

Try this:

=if( Only(Rank)<=20, 'green', if (Only(Rank)>20 and Only(Rank)<=40, 'yellow', if (Only(Rank)>40, 'red')))