Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

katrien_vanguch
New 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
New Contributor III

Re: Color expression in Map

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

MVP
MVP

Re: Color expression in Map

Try this

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

katrien_vanguch
New Contributor

Re: Color expression in Map

Hi Sunny,

Thank you it indeed works.

I also found another solution:

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

Community Browser