Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
katrien_vanguch
Partner - Contributor
Partner - Contributor

Color expression in Map

Hi,

I do not understand how expression for colors in a map work. I have made an expression where I want the countries to be colored if my field Animal='Bird'. I tried this in my first map but it only works after I have selected the value 'Bird' in my filter pane. Why does it not work without selecting the value 'Bird'. My app and source file are attached.

3 Replies
ericasense
Contributor III
Contributor III

It's because there is more than one animal associated with each country.

EG france has both "bird" and "cat" associated with it. At an aggregated level the if statement doesn't know which one to pick. What would you like it to do in this instance?

Erica

sunny_talwar

Try this

If(SubStringCount(Concat(DISTINCT '|' & Animal & '|'), '|Bird|') = 1, Red())

katrien_vanguch
Partner - Contributor
Partner - Contributor
Author

Hi Sunny,

Thank you it indeed works.

I also found another solution:

if(only({<Animal={'Bird'}>}Animal) = 'Animal',red())