Skip to main content

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Welcome to Qlik Community! Check out our new navigation! FIND OUT MORE
Showing results for 
Search instead for 
Did you mean: 
Partner - Contributor
Partner - Contributor

Color expression in Map


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



Try this

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

Partner - Contributor
Partner - Contributor

Hi Sunny,

Thank you it indeed works.

I also found another solution:

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