Standardise Country ­čîÄ

Danny RodenDanny Roden Administrator
edited July 7 in Functions Library

Standardise Country

The function uses reference data (contained within the .dmxd file) to standardise known country aliases to the standard form (e.g. England = United Kingdom).


See below for a preview of the logical definition of the function and a preview of the dataset that it comes with.


If, after processing your data, you identify there are quite a few records getting the 'Unknown Country' error message, you may want to add more aliases to this list in the lookup data.

You can do this by downloading the reference data from Data Studio (using the 'download as csv' button) and edit it accordingly.

Once you've made those changes, upload it into the existing dataset (using the 'Upload new data' button).

After you've done this the function will dynamically update to point at referencing the updated data.



Compatibility:

This function is compatible with all instances of Data Studio from v2.1.11 onwards.

[dl-button|Download|https://us.v-cdn.net/6031645/uploads/ZGCUF8SYYIUP/standardise-country.dmxd]

Comments

  • Henry SimmsHenry Simms Administrator

    IÔÇÖve been using this function recently, and have extended it to optionally match a country to its 3-letter country code, rather than just a standardized name.

    To do that, I've added an extra "Country code" column to the reference data domain:


    The reference data uses the ISO 3166-1 alpha-3 standard to define country code.

    And I've added a new function to return the code:

    While making those changes I also made a few improvements including:

    1. Added about 600 new country name aliases (from 928 to 1564)
    2. Corrected some issues in the original domain, eg to differentiate Congo / COG from Democratic Republic of the Congo / COD, rename Macedonia to North Macedonia, added South Sudan (SSD)

    Compatibility:

    This function is only compatible with all instances of Data Studio from v2.4.3 onwards.

  • Henry SimmsHenry Simms Administrator

    I've updated the country reference data domain to add some additional country aliases. This latest version of the "Standardize Country Name" function package is compatible with Data Studio v2.4.6 onwards.


Sign In or Register to comment.