6 Replies Latest reply on Jul 19, 2017 4:54 AM by Joshua Gearheart

    Simple latitude/longitude info

    Esther Twain

      Hi community,


      I'm having a hurdle setting up some custom geocoding.


      I have an Excel file with 6 sheets (6 tables), and I want one of them to have the columns Latitude and Longitude so I can plot it on a map. Meaning: this table, alongside normal columns that defines it (non-geographic info), should contain the columns Latitude and Longitude at, for example, city level (but with another name rather than City).


      I don't understand if I have to have a single file/sheet with a single hierarchy to be able to see what I want in a map... I just want to be able to plot some names corresponding to some Latitude and Longitude coordinates, but I don't want to create a whole new table containing just that info; I want the Latitude and Longitude to be in an already existing table. Also, do the columns in my existing table have to match the geographic field names that exist in Tableau (City)? Because I don't want to do that... I want to use another name.


      How, then, can I import this file into Tableau so it recognize the Latitude and Longitude coordinates?


      Thank you,




        • 1. Re: Simple latitude/longitude info
          Zhouyi Zhang

          HI, Esther


          If you could provide a sample workbook with your issue will be more helpful



          • 2. Re: Simple latitude/longitude info
            Jay Morehart

            If you want to add this so tableau recognizes your field ([Store Number] for example) as a geo location, you can add this info (including hierarchy info) by importing a csv file per the directions here: Custom Geocode Your Data


            It is also possible to assign a geo location to a field if there is a geo field(zip, state, etc) associated with it in the data source:


            Hope this helps!

            • 3. Re: Simple latitude/longitude info
              Esther Twain

              Hi Jay,


              But that's the thing: why do I have to setup a whole single csv file with a hierarchy, instead of doing it on an existing table? I literally just want the Latitude and Longitude info so I can plot some names on the map. Why doesn't this work?






              • 4. Re: Simple latitude/longitude info
                Esther Twain

                Hi Zhouyi!


                Unfortunately I can't provide a workbook The data is confidential and I'm not quite sure how to set it up on the superstore dataset...


                But thanks anyway!



                • 5. Re: Simple latitude/longitude info
                  Jay Morehart

                  Do you have the Lat/Lon data in one of the tables? if so you can simply put this on rows and columns

                  if not then when you say Latitude and Longitude at, for example, city level (but with another name rather than City). Do you mean that the field name is something different than City (but the data is city names) or the data is something different (like store names) but in the real world is tied to a specific lat/lon?


                  if it is city data in a field called [Locality], for instance, you can just assign it the geographic role of city, and Tableau will generate the lat/lon for cities it recognizes.


                  if you don't have lat/lon in your tables, and you don't have recognized geo-data (city, state, zip etc) (and this is what I thought you were asking, especially since you mentioned "custom geocoding") then the data to do what you want does not exist in your data set and you need to add it. You can either add it by, adding it to one of the already existing tables, adding a new table with lat/lon and joining to it (blending is possible but has its limitations), or add it to tableau as custom geocoding so Tableau recognizes your data as something with location info.

                  • 6. Re: Simple latitude/longitude info
                    Joshua Gearheart



                    Tableau will only geocode for you down to the city level, so if your data is more precise than that you'll need to add lat/lon to the datasource yourself or import custom geocoding.  Tableau's integration with R may help with the former: https://www.dataplusscience.com/Geocoding%20in%20Tableau%20using%20R.html