Why is my type: distance returning Unknown or Inaccessible Field?

Knowledge Drop

Last tested: Jul 24, 2018
 

With type: distance, if you're feeding the dimension with location dimensions in a different view, the sql_latitude and sql_longitude of the location dimension must be explicitly scoped in order for it to substitute correctly.

TL:DR-- Use ${TABLE}.latitude or ${view_name.latitude} in the type:location instead of just ${latitude}, or you'll get the error.

Example

dimension: shipping_distance {
type:distance
start_location_field: distribution_centers.distribution_center_location
end_location_field: users.user_location
units: miles
}

dimension: distribution_center_location {
type: location
sql_latitude: ${distribution_centers.latitude} ;;
sql_longitude: ${distribution_centers.longitude} ;;
}

This content is subject to limited support.                

Version history
Last update:
‎06-14-2021 05:55 PM
Updated by: