Question

Value formatting for 'location' type dimensions

  • 21 April 2015
  • 4 replies
  • 2261 views

Userlevel 3

When I include a Lat/Long location, I’d like the result to only display a set number of decimal places.


Even though I can format the values in the Lat and Long dimension, I seem unable to get the combined “location” dimension to display any custom formatting when using the value_format flag.


Any tips on how to format a location dimension?


4 replies

Userlevel 1

I typically use the round function, something like this:


  - dimension: location
type: location
sql_latitude: ROUND(${latitude},1)
sql_longitude: ROUND(${longitude},1)

Doesn’t this change the actual location though?

Userlevel 3
Badge

Hey @Mike_Ritchie,


That is true, it would be less accurate. I’ve made a note of the use case with our product team!

Cool, I don’t think most people intuitively know how to interpret lat and lon anyway, so even replacing the actual data with just an icon that would allow them to click thru to the Google map (e.g. a map icon) would be cool

Reply