Understanding and Using the TOCOUNTRY Function in Looker Studio for Enhanced Data Reporting

 Understanding and Using the TOCOUNTRY Function in Looker Studio for Enhanced Data Reporting

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 Syntax of TOCOUNTRY

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.

How the function works

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.

Parameters

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.

Examples

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|

Limitation of TOCOUNTRY function

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.

Tips for TOCOUNTRY function usage

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.

More function to use with Looker Studio

NARY_MAX
:
Utilizing the NARY_MAX Function in Looker Studio: A Comprehensive Guide to Enhancing Data Analysis Efficiency
WEEK
:
Analyzing and Presenting Your Data by Week: The Essential Guide to Using the WEEK Function in Looker Studio
MINUTE
:
Utilizing the MINUTE Function in Looker Studio for Precise Temporal Data Analysis and Report Generation
DAY
:
Exploring the DAY Function in Looker Studio: Maximising Insights from Your Date Data
POWER
:
Exploring the POWER Function in Looker Studio: Syntax, Usage, Examples and Tips for Data Analytics

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 lessons

All 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!
Looker studio

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!