Looker Studio Function: Looker Studio TOCOUNTRY Complete Guide with Examples : Use case

Category: GEO Function

The TOCOUNTRY() function in Looker Studio is a geographic conversion tool used to extract the country name from a geo or location field. It plays a key role in building region-based dashboards, segmentation, and performance analytics. By transforming location-based inputs into standardized country labels, TOCOUNTRY enhances accuracy and consistency in reporting.

Purpose TOCOUNTRY of the Function 

1. Country-Level Business Insights

TOCOUNTRY() allows analysts to convert raw location or geo fields into clean country names, helping identify performance trends and drive decisions at a national scale.

2. Audience Segmentation

Marketers can group users or customers based on their country, enabling localized strategy building and targeted advertising campaigns.

3. Geo-Mapping & Visualization

With standardized country outputs, TOCOUNTRY() simplifies building global maps, heatmaps, and benchmarking dashboards.

✅ Country-Wise Revenue or Sales Analysis

Analyze revenue distribution across different countries to identify top performing and emerging markets.

✅ Marketing Geo-Segmentation

Create customer segments based on country for personalized targeting.

✅ Global Expansion Planning

Compare KPIs across countries to evaluate new market opportunities.

✅ Improved Map Visualizations

Use country-level dimensions to build global business dashboards and heatmaps.

				
					TOCOUNTRY(geo_field)

				
			
ParameterTypeDescription
geo_field Geo / Location
The field from which the country name will be extracted
  

How the TOCOUNTRY Function Works?

TOCOUNTRY() analyzes the geographic information within the input field (e.g., coordinate, address, country code, or place name) and returns the corresponding standardized country name.

Example: If an input field contains a location like New Delhi, India, TOCOUNTRY(User_Location) returns “India”.

When Should You Use TOCOUNTRY?

  • Use TOCOUNTRY() when:

    • You need clean country names for analysis and grouping

    • Building global dashboards or multi-regional business reports

    • Applying location-based filters and segmentation

    • Visualizing international metrics in geo charts

Examples of TOCITY ?

Example 1: Basic Usage

TOCOUNTRY(User_Location)

If User_Location = “Tokyo, Japan”
Output → “Japan”

Example 2: Revenue by Country

SUM(Revenue) BY TOCOUNTRY(Location)→ Compares revenue performance across countries.

Gives a global revenue distribution across continents.


Example 3: Global Geo Map

Use TOCOUNTRY() in the dimension field of a Geo Chart
→ Heatmap by country.

Tips & Best Practices

⭐ Ensure geo fields contain valid location or address values
⭐ Use country groupings for executive-level summaries
⭐ Pair with CONTINENT or REGION functions for layered analysis
⭐ Works well with calculated fields and CASE expressions

1. What is the purpose of the TOCOUNTRY function?

The function converts geo or location data into standardized country names to support country-level reporting and analysis.

 

 

2. Can TOCOUNTRY process non-geo fields?

No, the input must be a geo-enabled or location-formatted field.

 

3. Does TOCOUNTRY impact original data?

No, it transforms values only in Looker Studio while displaying results for reporting.

 

4. How does TOCOUNTRY support segmentation?

It categorizes customers or KPIs by country, enabling better targeting and regional planning.

 

5. Is TOCOUNTRY useful in map charts?

Yes, it is essential for geographic visualizations such as world map heatmaps and region-based dashboards.

Established in 2020, Lets Viz Technologies provides a full range of high-quality data analysis and data visualization services. We are also an authorized Zoho Partner.

 

Contact

WeWork Berger Delhi One, C-001/A2, Sector 16B, Noida, Uttar Pradesh 201301

0124-502-5592
info@lets-viz.com

We are Social

Trust Pilot Reviews