Blog post

Case When in Looker Studio: How to use it

Data Studio (formerly Looker Studio)

Johan Chemin
July 13, 2023
| Lastest update
July 1, 2025

Connect to Looker Studio

Easily access your data and automate your report!

Connect to Google Sheets

Easily access your data and automate your report with Catchr's add-on!

If you are into data visualization and reporting, you are likely familiar with Looker Studio, a robust tool that allows users to connect to numerous data sources and create personalised dashboards and reports. Today, we focus on an essential feature of Looker Studio: the Case When statement, our key to unlocking advanced data analysis capabilities.

Understanding the functionality of Looker Studio Case When

CASE WHEN statement in Looker Studio defines conditions and returns a result based on the outcome of those conditions: if they are (or aren't) met. It enables you to create new categories or groupings based on conditional logic, thereby intensifying your data analysis and visualization potential.

Learn to operate Looker Studio Case When

​Using the CASE WHEN statement in Looker Studio is straightforward. You commence with the keyword "CASE," followed by one or more "WHEN" clauses, each detailing a particular condition to evaluate. The "THEN" clause pinpoints the result to return if the condition is true. If none of the predefined conditions meet, a default result can be laid out through an optional "ELSE" clause. The statement concludes with the term "END".

For example, you possess a dataset comprising information about website visitors, and you aspire to categorize these visitors based on the device they use. Here's how CASE WHEN comes into play:

CASE WHEN statement in a field creation on Looker Studio
CASE WHEN statement in a field creation on Looker Studio
CASE   WHEN device_type = 'Desktop' THEN 'Desktop User'   WHEN device_type = 'Mobile' THEN 'Mobile User'   ELSE 'Unknown' END


In this above example, if a visitor's "device_type" attribute equals "Desktop", the result displays as "Desktop User". If the "device_type" is "Mobile", the result exhibits as "Mobile User". In any case where none of these conditions meet, the output is "Unknown".

Enhance your data analysis capabilities with Looker Studio Case When


CASE WHEN in Looker Studio isn't a one-trick pony. It can also mingle with other functions and calculations within the tool. For instance, it can operate complex calculations using aggregated values, devise custom dimensions for effective data filtration and segmentation, and create dynamic visualizations pivoting on user interaction.

Understanding and utilizing the CASE WHEN statement opens the door to a more precise, customized, and insightful data analysis, pushing your Looker Studio abilities to a new level.

In conclusion, the Case When statement in Looker Studio is not just a feature. It's a powerful data wizard that lets you dive deeply into your datasets, realize customized analysis, and manifest visualizations genuinely tailored to your needs. It marks its position as an indispensable tool in every data analyst's Looker Studio toolkit. Embrace it, and enhance your data visualization game.

Start analyzing your data with a Looker Studio template

Catchr provides free dashboard templates to help you start analyzing your data on Looker Studio — 100+ available templates!

See all the Looker Studio templates

Start analyzing your data with a Data Studio template

Catchr provides free dashboard templates to help you start analyzing your data on Data Studio — 100+ available templates!

See all the Data Studio templates

More blog post about

No items found.
TURN DATA INTO GROWTH

Bring your Marketing data together, where it really matters

With Catchr, pull data from all your platforms, export it to dashboards, spreadsheets or databases, and track the metrics that drive your business.
Start moving your data
14 days free-trial - No credit card required 🎉