Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
A sample from my data (full dataset contains all countries of the world). Each row contains a combination of country and animal. Multiple animals can be assigned to one country and one animal can also be in multiple countries.
Country ISO alpha 3 code | Animal |
---|---|
IND | Cat |
USA | Cat |
USA | Dog |
GBR | Cow |
GBR | Dog |
NOR | Cat |
What I would like to achieve is to color the countries on a map based on whether an animal is in that country. I have created the map based on the Geo dimension 'Country ISO alpha 3 code'. To keep it simple I would like to just create a map that colors countries with cats. To do this I use 'Color by expression' and the expression if(Animal='Cat','red').
Problem: on the map only NOR and IND are colored in red. If you look at the sample data, the USA should also be red.
Thanks,
Benjamin
Try this
If(SubStringCount(Concat(DISTINCT '|' & animal & '|'), '|Cat|') = 1, 'red')
Try this
If(SubStringCount(Concat(DISTINCT '|' & animal & '|'), '|Cat|') = 1, 'red')
Thanks Sunny!