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

Category: GEO Function

The TOCITY() function in Looker Studio is a powerful geographic conversion tool used for extracting city names from location-based fields. It simplifies region-level reporting, segmentation, visualization, and geo-based analysis by transforming geographic values into identifiable city labels.

Purpose TOCITY of the Function 

1. Regional Performance Insights

TOCITY() helps convert raw geo-coordinates or mixed location fields into city names, enabling comparison of performance across different regions—such as city-wise sales, leads, or website traffic.

2. Marketing & Audience Segmentation

By standardizing city data, marketers can segment customers based on actual city-level users rather than broad regions, improving localization strategy and targeted campaigns.

3. Visual Mapping & Geo Charts

This function makes it easy to build visual geo-maps, heatmaps, and comparison charts where city-wise aggregation is required.

Why Use TOCITY in Looker Studio?

Type of Calculation & Practical Use Cases

✅ City-Wise Revenue or Sales Analysis

Group revenue or conversion data by city to identify top-performing markets.

✅ Regional Growth Tracking

Measure growth trends across locations to plan distribution and logistics.

✅ Customer Location Segmentation

Create audience clusters using city data for targeted communication strategies.

✅ Geo-Based KPI Reporting

Apply TOCITY() to mapping charts for precise city-level visualization.

				
					TOCITY(geo_field)

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

How the TOCITY  Function Works?

The TOCITY() function extracts the city information from a given geographic data field (e.g., full address, coordinates, or location hierarchy). For example, coordinates referring to Delhi will return “Delhi”, enabling clean grouping and comparison in reports.

When should use the TOCITY  Work?

Use it when:

  • You need readable date & time in dashboards

  • You must convert datetime to a formatted string before concatenation

  • You want to format timestamps before export

  • You are building executive dashboards, print layouts, or client presentations

Examples of TOCITY ?

Example 1: Basic Usage

TOCITY(User_Location)

If User_Location = “New Delhi, India”
Output = “New Delhi”

Example 2: Geo-Mapping

Apply TOCITY() to a calculated field and use it in a Geo Chart dimension
City-level heatmap visualization


Example 3: Combining with Aggregation

SUM(Revenue) BY TOCITY(User_Location)

This calculates Revenue by City for improved business insights.

Tips & Best Practices

⭐ Ensure geo fields are consistently formatted
⭐ Use TOCITY() before applying SUM(), COUNT(), or CASE filters
⭐ Improve dashboard performance using city-based grouping rather than raw addresses
⭐ Works best when paired with map-style visual charts

1. What is the purpose of the TOCITY function?

To extract city names from geographic fields, making data easier to group, compare, and visualize geographically.

2. Can I use TOCITY with non-geo fields?

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

3. Does TOCITY change the original data?

No, it only transforms data within Looker Studio for reporting—it does not modify source records.

4. How does TOCITY help in marketing segmentation?

It allows segmentation of revenue, audience behavior, or engagement based on city locations for localized strategy building.

 

5. Is TOCITY useful in map visualizations?

Yes, it is highly useful for creating city-level heatmaps, regional trend charts, and geo-performance 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