Last Modified Date: 03 Jan 2024
Environment
Tableau DesktopAnswer
Tableau recognizes only the first three characters of the six-character Canadian postal code - the forward sortation area. If Canadian postal codes in your data are formatted with all six characters, you can create a calculation to map the postal codes.If all your postal codes are Canadian
The below instructions are based on the attached canadian_postal_codes.twbx- Select Analysis > Create Calculated Field
- Name the field Postal Code, enter the following formula, then click OK:
LEFT([Customer Postcode], 3)
- In Dimensions, right-click Postal Code and select Geographic Role > ZIP Code/Postcode.
- Drag Postal Code to Detail.
If your data contains both US and Canadian postal codes
The below instructions are based on the attached multiple_countries_postcodes.twbx.- Ensure that your data source has a column for country names. In this example, the field is called Country.
- Select Analysis>Create Calculated Field
- Name the field Postal Code, enter the following formula, then click OK:
IF [Country] = "Canada"
THEN LEFT ([Customer Postcode], 3)
ELSE [Customer Postcode]
END
- Drag Postal Code to Detail.
- If not all postal codes appear and # unknown appears in the lower right hand corner of the viz, you might need to edit their locations. For more information, see Edit Locations.
Additional Information
For a list of zip codes and post codes recognized by Tableau, please refer to What data does Tableau support for building map views.Thank you for providing your feedback on the effectiveness of the article.
Open new Case
Continue Searching
Knowledge Base
Community
Product Help
Training and Tutorials