1 2 Previous Next 16 Replies Latest reply on Feb 14, 2012 10:58 AM by Richard Leeke

    zipcode map of multiple countries


      When I want to visualize data for the so called TriRhena regio, i.e. a part of Switzerland, a part of Germany and a part of France - each part defined by a couple of zipcodes - how can I get a filled map of it.

      In other words it is also the question how to proceed when joining data of different countries based on zipcodes which can be different in format (4 digits in Switzerland, 5 digits in France and Germany, ...)

        • 1. Re: zipcode map of multiple countries
          Shawn Wallwork

          Hi Reinhold, it doesn't look like Switzerland has zip code support yet. Here's Tableau's list of supported zips:

          zipcodes supported.PNG

          Here's the link to the page: http://kb.tableausoftware.com/articles/knowledgebase/mapping-basics You might want to contact support to see if there's any plans for filling in the rest of Europe.



          • 2. Re: zipcode map of multiple countries
            Shawn Wallwork

            Reinhold, I just did a quick test of a few German postal codes, and while they do show up on a map as dots, they do not appear to be supported as filled maps.



            • 3. Re: zipcode map of multiple countries

              Hi Shawn,

              thanks for your reply.

              Regarding Swiss ZIP codes I had already a successful try using custom geocoding. But then the question is how to mix custom geocoding and Tableau integrated geocoding in one data set / map.

              • 4. Re: zipcode map of multiple countries
                Shawn Wallwork

                Interesting! I'd really like to see what you've done with the custom geocoding. Richard has been doing a lot of work in this area, so I'll let him take this question (if he has time). Before seeing your implementation of the geocoding the only suggestion I have is try creating a dual axis map and then using the second axis to display additional info you're looking for from Tableau. But this totally depends on your implementation (and definition) of custom geocoding. Please post a sample, I'd really like to take a look.



                • 5. Re: zipcode map of multiple countries
                  Richard Leeke

                  Only US zipcodes have filled map support at this stage - I've no idea about future plans.


                  As for using the built in (point) geocoding for some countries and custom geocoding for other countries, I think that is doable with a dual axis map. I'm fairly sure I've done something similar. I'd need to try it to be sure, but here's what I think you need to do. It depends a bit how your data is structured, so I'm assuming your source data has a country field and a zipcode field and also that you have added the Swiss custom geocoding underneath Country in the geocoding hierarchy. If not (or if you can't make thyis work), maybe post a sample and I'll have a look.


                  1) Make a duplicate copy of your zipcode field.

                  2) Check that your original zipcode field has been automatically geocoded to Tableau's built-in zipcode.

                  3) Manually assign your custom geocoding to the duplicate field.

                  4) Create a map, with zipcode on Level of Detail, and Latitude (generated) and Longitude (generated) on Rows and Columns.

                  5) Put a second copy of Latitude (generated) on Rows, and select dual axis.

                  6) On the marks shelf, select multiple mark types and then replace the original zip code with the duplicate for the second Latitude instance.


                  That should do it.  Or something like that.   I think. ;-)

                  • 6. Re: zipcode map of multiple countries
                    Tom Brown

                    I haven't actually tried this, but have you considered uploading a csv file with 4 fields?  country, zip code, lat, long.


                    Then you'll have to provide both country and zip code in your data set, and put both on level of detail.  This works against the internal geocoding when using country and city.





                    1 of 1 people found this helpful
                    • 7. Re: zipcode map of multiple countries

                      That sounds interesting and would be a variation of what I did so far: import of a csv file containing zipcode, longitude and latitude. Will try your idea by including the country code as well - curious whether this works in combination with other countries. For Switzerland alone it worked of course already without the country code.

                      Cheers Reinhold

                      • 8. Re: zipcode map of multiple countries
                        Richard Leeke

                        I'm fairly sure you'll need a dual axis with the two copies of zip code with different geographic roles, as I described above.  If you only have one copy of zip code it can only be geocoded using either Tableau's built-in geocodong or your custom role.


                        Tom's quite right that you should have country on the view (that is needed to ensure you uniquely identify each zip code, so in practice that will only matter if there is any duplication of zip codes between the countries you are interested in).

                        • 9. Re: zipcode map of multiple countries

                          But how can I have a dual axis with a map ?

                          Another issue as I suppose is that a zipcode by default is defined as a 5-digit number but Swiss zipcodes are 4-digit numbers. So how can 4-digit numbers and 5-digit numbers be mixed (also when leading zeroes should be allowed) ?

                          • 10. Re: zipcode map of multiple countries
                            Richard Leeke

                            Try following the steps I outlined above.  If you duplicate the Latitude field you'll get two maps. Right-click the 2nd copy of latitude and select dual-axis and the two copies of the map are now overlaid. Then when you set multiple mark types on the marks shelf you can choose different settings for the two copies.


                            I did something very similar to this in a thread for Shawn a week or two ago - I can't quite remember what the point of the thread was but he was showing population and other demographics by zip code - including distances from a retail store.  I'll see if I can dig out the thread for you, that will demonstrate some of the concepts.


                            The best bet would be if you posted a sample workbook (or even a CSV file with a sample of Swiss zip codes and lat/long coordinates). Actually the best bet is probably just to post your custom geocoding file.  If you do that I'll have a go at it for you.


                            The leading zeroes issue is probably that you need to force MS JET to treat the zip code as a string not a number.  Either enclose the zip code in double quotes or create a schema.ini file.  Search the knowledgebase and/or the forum if you're not familiar with schema.ini.


                            I'm not 100% sure my steps above will work, but I'm pretty confident it's doable and those steps are on the right lines.

                            1 of 1 people found this helpful
                            • 11. Re: zipcode map of multiple countries

                              Here a ZIP file with the used components for this sample.

                              Would be great if you could find a way / solution how to manage this.

                              Cheers Reinhold

                              • 12. Re: zipcode map of multiple countries
                                Richard Leeke

                                You were almost there.


                                You can do it with a dual axis in the way I described above, though there were a couple of minor issues to work around.


                                The main problem is that your custom geocoded zips haven't been added into the geocoded hierarchy - so Tableau doesn't know that the Country field in that file relates to the Country geocoding role that it knows about. So when you have Country and Zip code on the view in order to identify the french and german zips, and then remove that instance of zip from the dual axis, it leaves country, which Tableau knows is geocoded. So initially you get a mark for each french and german zip and then a single mark for the whole of Switzerland.


                                So you need to take country off the Level of Detail shelf for the dual axiis that you place ZIP_CH on, otherwise built-in geocoding of country over-rules custom geocoding of zip (it seems!). But that still didn't work because you also had Country on the Colour shelf. So I made a copy of Country and removed the geocoding from that, and put that on colour.  Hey presto, you get this:



                                You also get messages about unrecognised locations. That is because the swiss codes aren't found in built-in geocoding and the french and german ones aren't found in your custom geocoding. You can just suppress those by filtering the null values of the lat and long (generated) fields.


                                So this works for your case, but wouldn't quite cope if you wanted to use custom geocoding for zips from multiple countries.


                                I'm pretty sure the solution there is "just" to adjust your custom geocoding file so that Tableau knows what the country code is and so adds it into the hierarchy properly. There's always a lot of trial and error involved in getting that to work - the documentation is really rather inadequate for that (or it was last time I looked).  I think you need to tell Tableau that your country code in your custom geocoding file is a 2 digit ISO code (ISO3166_2) as opposed to a name or a FIPS code (CH is China in FIPS coding). In the past I've managed to get things to work by hitting on the exact field names expected by Tableau (but I've not found a good description of what those are).  I had a quick go just now but couldn't work it out.

                                1 of 1 people found this helpful
                                • 13. Re: zipcode map of multiple countries
                                  Shawn Wallwork

                                  Richard I spent 2 hours on that map this morning, and I didn't even get close! It never ceases to amaze me that no matter how much I work at it I still don't really understand how Tableau processes things.



                                  • 14. Re: zipcode map of multiple countries

                                    Hi Richard,


                                    first of all thanks very much for your efforts. This is the way I intended to go forward. I try next to understand what you did to complete my tries and then will see how I could go further on visualizing my data analysis.

                                    Cheers Reinhold

                                    1 2 Previous Next