forums
Use these forums to ask questions and discuss Tableau.
Can I use lat/long from my OLAP database?
Posted September 4th, 2008 by laird
in Maps & Links
I have an OLAP database that has a latitude and longitude already in the database (as an attribute, not a measure). How can I get Tableau to use the latitude and longitude from the database? I would expect to be able to set the 'geographic role' of the fields to 'latitude' and 'longitude' but there doesn't appear to be a way to do that.
I also have zip codes and region codes that I could use, and have Tableau map to lat/long, but Tableau only seems to recognize US states and zip codes, and I have international data.
Comments
Iaird,
With respect to the first part (latitude and longitude attributes of a cube) we tried to get this into 4.0, but it did not make it in time.
There is something that you can do which we think should work, which is to create a calculated member for latitude and longitude. I'm assuming that you use MSAS -- it would be a little different for Essbase.
1. From the schema viewer, click on the triangle of the Measures area and select "Calculated Members...".
2. Click the new button, type the name of your new field, e.g. "My Latitude."
3. For the hierarchy, type in [Measures] or select it from the list.
4. Choose float for the data type.
5. In the formula type an expression for the attribute's value, for example[Customer].[Latitude].MemberValue.
6. Click "Check Formula" to check yourself.
7. Click OK on the dialog box.
8. Change the geographic role of your new measure to Latitude.
9. Repeat 1-8 for Longitude.
Now when you want to use these to create a view, make sure you have the appropriate level on Row, Column or Level of Detail shelf. For example, if you have lat and long per customer, put the Customer somewhere. A simple thing might be just to put the original attributes on the Level of Detail shelf.
There can be a couple of things might get mixed up, so follow up in this forum with any problems and we can try to work through them.
Moving on to your second question about international geo-coding, Tableau does do some of it: Countries and States. There is a wide variety of spelling variations on the country and state names, so if you are seeing that they do not match, there is a way to correct them: In the schema viewer right click on the dimension, select "Geographic Role" and go to the bottom and select "Edit Locations." It will bring up a dialog to let you fix any mismatches.
I can confirm what you observed, namely that Tableau currently does not do geo-coding of postal codes outside the US.
I would like to request British postal codes be added ASAP.
I would like to request Canadian Postal codes too :)