Data & Reporting Tool

Looker Studio Formula Generator

Generate flawless CASE WHEN and REGEXP_CONTAINS functions instantly without writing complex SQL codes. Visually group your campaigns and data.

The exact name of the existing field you want to filter in Looker Studio (e.g. Campaign or Ad Group).

Matching Rules

Looker Studio Formula
Formula Copied!

The (?i) flag inside automatically makes the match case-insensitive!

Mastering Data Clean-up in Looker Studio

If you're a performance marketer or data analyst, you know the struggle well. You pull data from Google Ads, Meta Ads, and LinkedIn into Looker Studio, but the campaign names are a complete mess. Some say "Brand_Search_UK", while others say "brand-search-uk". Trying to create a clean pie chart with this raw data is impossible.

The solution is to create a Custom Calculated Field in Looker Studio using a CASE WHEN statement combined with REGEXP_CONTAINS. However, writing SQL-style syntax manually is extremely prone to syntax errors (like forgetting a closing quote or parenthesis) which breaks your entire dashboard. Our visual builder eliminates this frustration by generating flawless code strings instantly.

The Power of Regex

Our tool automatically injects the (?i) modifier into your formula. This tells Looker Studio to be Case-Insensitive. It will automatically group "Video", "VIDEO", and "video" together without you needing to write three separate rules.

Multiple Matches

You can separate words with a vertical pipe (|) symbol in the condition box. For example, typing retargeting|rmkt|remarketing will catch all three variations and neatly group them into a single "Remarketing" bucket.

Frequently Asked Questions

Where do I paste this code?

In Looker Studio, go to your Data Source and click ADD A FIELD. Paste this generated code into the Formula box, give your new field a name (e.g. "Campaign Category"), and click Save. You can now use this as a dimension in your charts.

What happens if a row matches two rules?

The CASE WHEN statement evaluates rules from top to bottom. The moment it finds the first true condition, it assigns the category and stops (it does not look at the rules below it). Therefore, always make sure to put your most specific and priority rules at the top.

Do I need to add quotation marks in the generator?

No! Our generator handles all the SQL syntax in the background, including single quotes and parentheses. You just type your normal text (e.g. brand) and your desired output (e.g. Brand Campaigns).