Freakalytics®

Practical Analytics for Better Decisions

Freakalytics™ header image
 

Mapping Canadian Postal Codes in Tableau

A recent training attendee asked for assistance with mapping Canadian customers by Postal Code. Tableau can do this, but you must complete two steps before mapping data at the Canadian Postal Code level.

1) You will need a data file with location details by Postal Code. Specifically, you will need a list of Postal Codes by latitude and longitude. It should look similar to this detailed custom geocoding example:

Country (ISO 3166-2),Country (Name),PostalCode,CityName,CityType,ProvinceName,ProvinceAbbr,Latitude,Longitude
CA,Canada,E3A 1A4,Fredericton,D,New Brunswick,NB,45.97771,-66.67843

At a minimum, you will want the data to contain:
PostalCode,Latitude,Longitude
E3A 1A4,45.97771,-66.67843

If you already have Postal Code data in your organization, you simply need to save it as a well formatted CSV file. Here is a sample I built using data from ZipCodeDownload , which sells detailed zip code data files. I used their sample in my example .CSV file. The full data is $100. Note, Freakalytics receives no compensation from this zip code company nor have we verified the accuracy of their data. There are many competitors selling similar data that you should review before selecting the best data provider for your needs.

2) Once you have the location details CSV file, place it in a Windows file directory for all of your custom geocoding files used in Tableau. Open Tableau, connect to a data source and then import the custom geocoding CSV file (Data -> Geocoding -> Import Custom Geocoding).

Once the import is completed, you can now use any data source with Postal Codes, simply associate the data item with the custom ceodcoding by right-clicking the data item from the Dimensions pane, select Geographic Role -> Postal Code. Data items at the Postal Code level is now available for mapping! You can download my sample workbook from Tableau Public below. Note that packaged workbooks contain the imported custom geocoding created by you.

Related articles and thoughts

 

Tags:   · · · · · 2 Comments


Posted on September 28th, 2010 by Stephen McDaniel

Leave a Comment


5 − = two

2 responses so far ↓

  • I really like bottom sheet as a replacement for the size legend. I’ve never really liked the default size legend, so I know I’ll be making use of the technique you used here in the future.

    Also using this sheet as a filter, allows it to continue to be useful as a way to select a range of values instead of a slider.

    This is a great dashboard all around, thank you for sharing it.

    • Joe, it is always nice to hear objective feedback from a fellow enthusiast! In my 13 years of creating dashboards, I still am fascinated with the value of subtle enhancements. They can add tremendous value for the audience.

      I personally like this dashboard for the level of simplicity yet rapid insights available from it.

      All the best,
      Stephen