Why isn't my measure plotting with a built-in map layer?

Knowledge Drop

Last tested: Mar 10, 2020
 

Does your map look like this:
Screen Shot 2020-03-10 at 8.54.33 AM.png

It looks like we have a map_layer properly defined. And we can even see our values populated in the legend of the visualization, but nothing populating for the states. The LookML looks legit like this:

dimension: state {

type: string

sql: ${TABLE}.state;;

map_layer_name: us_states

}

If we see this behavior, we should double check for whitespace in the underlying field. We can do this in the Explore by adding an `ends with` filter like the following:

Screen Shot 2020-03-10 at 9.02.31 AM.png

Since we still have results, we know we have trailing whitespace in the State field which is preventing us from mapping the State values to the map_layer property_key.

The solution is to make a change in the underlying database or wrap the field in a TRIM() function like so:

dimension: state {

type: string

sql:TRIM(${TABLE}.state);;

map_layer_name: us_states

}

Then we should see these values plot as expected

Another case is for when we are filtering on the information that does match with Full country name and still not being populated. So, for the map layer dimension, there could be a mix of iso and full country names, but it is case sensitive and has to match the ISO specs.

This content is subject to limited support.                

Version history
Last update:
‎07-07-2021 01:13 PM
Updated by: