COUNTRY_TO_ALPHA3

Description

COUNTRY_TO_ALPHA3 converts an ISO 3166-1 alpha-2 country code (2 letters) to the corresponding ISO 3166-1 alpha-3 country code (3 letters).

Returns unknown if the input is not a recognised alpha-2 code.

Syntax

COUNTRY_TO_ALPHA3(alpha2)

Returns: A 3-letter alpha-3 country code string, or unknown if the input is unrecognised.

Example

COUNTRY_TO_ALPHA3('CH')

This returns 'CHE'.

COUNTRY_TO_ALPHA3('DE')

This returns 'DEU'.

COUNTRY_TO_ALPHA3('XX')

This returns unknown'XX' is not a valid ISO country code.

Example in context

p is Person
COUNTRY_TO_ALPHA3(p.nationality)

Converts the 2-letter nationality stored on a person to its 3-letter equivalent, e.g. for use in downstream systems or document generation that requires alpha-3 codes.

Last updated

Was this helpful?