Google Data Studio comprises an extensive assortment of functions, one of which is the TOCOUNTRY function. This function is instrumental in identifying the complete name of the country from the corresponding country code or geolocation submitted as input.
The proper usage and application of the TOCOUNTRY function will allow users to transmute ISO codes or specific geolocation identifiers into comprehensive country names, heightening the readability and understanding of data representation.
The TOCOUNTRY function maintains a fairly simple syntax structure. The function accepts two parameters, with the second being optional. The syntax will look like this:
markdown
TOCOUNTRY(X [,Input Format])
Where the parameters are,
X
- A text field or expression, or a geo field or expression.Input Format
- This is optional, and used to define format for the X
text field.At its core, the TOCOUNTRY function transmutes region specified either as an ISO code or other geographic identifiers into the full-name representation of the corresponding country.
For instance, using "US" as input will yield "United States" as its output.
TOCOUNTRY accepts the following input formats if
X
is a text field :
COUNTRY_ISO_CODE
REGION_ISO_CODE
If the input "X" is already configured correctly as a geo field, providing the Input Format is optional.
Let's consider a few examples in a sales metrics context. Suppose we have a dataset that contains sales data across different countries, represented by their ISO codes.
Suppose, the raw data is as:
|Country_Code| || |FR| |JP| |IN|
Now, let's consider an application of the TOCOUNTRY function:
markdown
TOCOUNTRY(Country_Code)
Post application of the function, the output would look something like this:
|Country_Code|Country| ||| |FR|France| |JP|Japan| |IN|India|
While the function is valuable in enhancing data readability, its usage is constrained by the requirement of correct ISO country codes or valid geolocation identifiers. Erroneous codes or identifiers may result in inaccurate output.
Tip 1: Ensure the entry for the 'X' parameter is accurately configured as a geo field or as a text field in the acceptable format.
By following these instructions, you will be able to reap the full benefits of Google Data Studio's TOCOUNTRY function to enhance your data analytics and reporting tasks.
Become a Looker Studio expert
for free
Learn all the secrets of data analysis and create beautiful and effective dashboards thanks to our 30-second video courses! Join Catchr's community on YouTube.
Get more video lessonsAll your data on Looker Studio
Build Looker Studio dashboard easily with your marketing data from all platforms and track your essential KPIs! No-code integration.
Start free trial now!Optimize your data analysis
Get free Looker Studio dashboard template among a large collection of +50 stunning template! Elevate your data visualization.
Get free templates!