12 Replies Latest reply on Sep 13, 2018 6:42 AM by Simon Runc

    Unknown regions

    thibault.btrmieux.0

      Hello,

       

      I am using Geonames for my analyses and there are a lot unknown regions (and even when looking with other names I can't find them). When it comes to zip codes or cities I can complete the data of Tableau by using my own latitude and longitude. In this case they are just points on the map.

      Here I also want the shape of the region and I didn't find any shape data for those regions (I'm not even sure how this would work).

       

      All the regions shown here come directly from Geonames and I have the country for all of them:

      Missing_regions.png

       

      So what happens if I try to add my own regions is this:

       

      I only get two little tiny dots because I am missing the shape. (Note that in this case Kanton Appenzell Innerrhoden actually exists in Tableau under the name "Appenzell Inner Rhodes", normally I have a function that takes care of that but I wanted Tableau not to recognize it for the example).

       

      I am not very hopeful that there is a solution for this but I am posting this anyways. Maybe Tableau could add some data or maybe I missed something, who knows.

       

      Thanks for taking the time to read this

       

      Cheers, Thibault

        • 1. Re: Unknown regions
          Simon Runc

          On the Cornwall one...does your country field show it in the United Kingdom or England?

           

          Looks like it needs to be UK

           

           

          When plotting across multiple countries, Tableau (generally) needs a Country field...for example there are loads of "Cambridge" in the world (now I'd say that if Tableau isn't given the country, I'd like it to guess....the most usual case being Cambridge in the UK!...but it doesn't)

           

          Hope that helps knock off a few

          • 2. Re: Unknown regions
            suman kumar

            Hi,

             

            Can you please check that which country you have selected in this option.?

            Screen Shot 2018-09-13 at 4.01.10 PM.png

            Please select country and then start creating map report. Bring Longitude and Latitude in the sheet and then right click in the sheet.

            Where you'll get "Edit Locations" Option. then select country which ever you want.

             

            Best

            Suman

            • 3. Re: Unknown regions
              thibault.btrmieux.0

              Thanks to everyone for your answers . I took some time to export a .twbx with all regions from Geonames. I made sure all the countries were recognized and used a little trick so that you can see all the regions that are not detected.

              You can download the .twbx notebook here: https://public.tableau.com/views/Regions_test_tableau/Geonames?:embed=y&:display_count=yes&publish=yes

               

              https://public.tableau.com/static/images/Re/Regions_test_tableau/Geonames/1.png

              • 4. Re: Unknown regions
                Simon Runc

                Very cool...and nice use of filtering!

                 

                So for the UK the problem is that you have county level names (which are different from state/province). If I change to county they they get plotted

                 

                 

                For the UK the State/Province level is England, Scotland, Wales & Northern Ireland (which I'd say are countries...but people could argue it both ways!!)

                 

                What you can do (although if you have a 3rd level I'm out of ideas!) is to create a copy of Region, I've then renamed it County and set it be county geographic type.

                 

                I then create a second axis, place this in the level of detail (so this will plot any "regions" that are defined as counties) and then dual axis them.

                 

                I've made the "county" level ones Red, so you can see what it's doing.

                 

                Hope that makes sense?

                1 of 1 people found this helpful
                • 5. Re: Unknown regions
                  thibault.btrmieux.0

                  WOW very nice! Did not think of doing this. So in the case of regions analyses I have not planned to use a dual axis yet so it is alright.

                   

                  And nice catch by the way I did not mention that I set United Kingdom to a more detailled level. Because "England" or "Ireland" is a bit large for me . I checked my code for downloading Geonames data again and it is the only exception.

                   

                  Since it is the only exception I set a calculation like  this:

                   

                  Field name = "Region (as county)"

                  IF [Land] == "Vereinigtes Königreich" THEN [Region] ELSE NULL END

                   

                  • 6. Re: Unknown regions
                    Simon Runc

                    Glad it helped (btw there is not need to do the double dual axis...you only need to dual either Long or Lat)

                     

                    So one way I can think, if you want to look at different levels (as Tableau sees them) of geography together, would be to build up your data (looks like you have good system of easily selecting and regenerating levels!) from the lowest level you need (in this case county), you can then bring in the level (as a field) that you actually want. So in the case of the UK, counties would all be their county name, but in the case of USA, every "county" for a region (say California) would have the name California.

                     

                    You can then use Tableau's custom regions, and set it off that 2nd field. (example attached with California (state) and Devon, Cornwall (counties) plotted on same map)

                     

                     

                     

                    This may cause more problems than in solves, as I'm not sure if Tableau goes down to county for every country...just a thought.

                    1 of 1 people found this helpful
                    • 7. Re: Unknown regions
                      thibault.btrmieux.0

                      Sorry but I don't really get it. Using the menu in your screenshot creates a hierarchy (from region to country btw which does not make sense ?!).

                      Also I don't see how you can avoid dual axis because adding a finer level like a county makes Tableau do this:

                      Search for country -> search for region within country - > search for county within region

                      In this case it makes my map almost completely blank (note that I have modified the field "Region (as county)" it is an identical copy of Region with "county" as geographical role).

                       

                      • 8. Re: Unknown regions
                        Simon Runc

                        So I've probably not explained either very well!

                         

                        ....If a picture tells a 1000 words, a moving picture tells 10,000!! I've attached 2 .gifs showing each of the 2 things

                         

                        On the dual axis one you don't want both Region and County (just county) as Tableau looks for UK (country), Cornwall (state/province), Cornwall (county) and says that is not a combination I know, but when you use just Country and County is says "oh I know a county called Cornwall in the UK"!

                         

                        Or to put in another way...

                        Tableau doesn't build it's geo-mapping from just a single name, it uses all levels it can find; So "New York" alone won't plot, is needs "USA" -> "New York". Which means that Although "UK" -> "England" -> "Cornwall" does exist, "UK" -> "Cornwall" -> "Cornwall" doesn't.

                        • 9. Re: Unknown regions
                          thibault.btrmieux.0

                          Thanks for your answer Simon .

                           

                          Which means that Although "UK" -> "England" -> "Cornwall" does exist, "UK" -> "Cornwall" -> "Cornwall" doesn't.

                          I had never thought about that. On this note I tried setting the region to null when it's UK and "UK" -> NULL -> "Cornwall" also does not exist. I just tried and it does not work (also any other county won't appear for that matter).

                          The dual-axis is also clear to me.

                           

                          How you managed to get Cornwall and California on the same map without the dual-aixs however is still a complete mistery despite the gif. What is in the field "Level I want" ?

                           

                          After that operation there will still be a lot of regions unknown but you have already helped me. Besides the .twbx allows me to check all values that don't work and I can complete my mapping to automatically rename region and country names to make them compatible with Tableau.

                          So sometimes you just have to rename it e.g. I have replaced "Centre" with "Centre-Val de Loire". But sometimes it just does not seem to exist in the Database Tableau uses (OpenStreetMap apparently).

                          • 10. Re: Unknown regions
                            Simon Runc

                            Glad it made a bit more sense!

                             

                            So the for "Custom Geographies", Tableau lets us build our own Geographic level from a level it knows. A simple example would be that if I want to create management-regions for a retailer (that is my line of work), which obviously won't exist in Tableau (or even any ONS map!). I can have, say, the County level (which Tableau does know in my data) and then another field, called management-region), like this

                             

                             

                            I can then Tableau to Group the County Level to the Management Level, via County...and I can now use this new Management Level as a Geographic data type.

                             

                            You can actually do this on the fly, using the "grouping" method. If I have a map with County...I can select Devon and Cornwall (on my map) and select Group, and Tableau will create me a new aggregated level which is a single aggregation for the counties Devon and Cornwall

                             

                            I've just got a bit hacky with this feature where I'm saying Group all the California Counties to a level called "California"....but Group Cornwall to Cornwall, Devon to Devon...etc.

                            1 of 1 people found this helpful
                            • 11. Re: Unknown regions
                              thibault.btrmieux.0

                              I finally got it ok! But it means I have to get all county names. I think I'll stick with the dual-axis solution if you don't mind . But I have never using this grouping thing and I did not understand the "create from" thing until now so it could be useful in the future .

                              • 12. Re: Unknown regions
                                Simon Runc

                                ...if you don't mind

                                Not at all! That's the solution I'd go for to. Tableau has different levels of grain and coverage depending on the country you are in (eg. UK, US and Europe is pretty complete, but African counties less so), so when working across countries it can be hard to find a level that works for all. So you'd just not need to find all county names, but also the names that Tableau uses (eg. UK changes it counties from time to time, so you need to know if its the 2013 or 2015 name!) and also know what Tableau defines as a county (eg. the country of England being defined as a province/state!); Basically it depends how big Tableau is in that country on how much effort they put in to completing the geography!!...India, for example, has got much better coverage over the last year as it's now a big market for them.

                                 

                                It is useful to know though, and in my line of work, where each retailer defines their own management-regions it's pretty useful...although since the addition of shapefile support, I tend to just create my own (using QGIS or GeoPanada library in Python) and then use that.

                                1 of 1 people found this helpful