Notification

This Help Center is moving to Cloud. Learn more about the migration.

Filter examples

 

Include only United States, Canada, or Mexico

Suppose you want to limit a chart's information to just data coming from the United States, Mexico, or Canada. Select the chart and add the following filter:

  1. Include/Exclude: Include
  2. Dimension: Country
  3. Match Type: IN
  4. Value: United States, Canada, Mexico

The Edit Filter dialog for a filter called Country filter, with the settings Include In United States, Canada, Mexico for the field Country.

You could also do this using 3 OR clauses. But it's easier to use IN with a list.

Exclude "(not set)"

To exclude "(not set)" values from your charts, use an Exclude filter. For example:

  1. Include/Exclude: Exclude
  2. Dimension: Campaign
  3. Match Type: Equals
  4. Value: (not set)

The Edit Filter dialog for a filter called Exclude not set filter with the settings Exclude Equal to (=) (not set) for the field Campaign.

Find data at the end of a value

The RegExp Match and RegExp Contains operators let you perform more complex matches. For example, to filter data that contains a value at the end of the data, you can use the end-of-line marker $:

  1. Include/Exclude: Include
  2. Dimension: Medium
  3. Match Type:: RegExp Match
  4. Value: .*c$

The Edit Filter dialog for a filter called Include c at end of data with the settings Include RegExp Match .*c$ for the field Medium.

When applied to the Analytics Medium dimension, you'd include values like "organic" and "cpc."

Understanding the regular expression: .*c$

.* means "match anything" (including nothing),

then the literal letter "c"

$ means the "end of line" character. (To match the beginning of the string, use ^.)

Here's another example:

^c.*k.*$ matches text that begins with the letter c, followed by anything , followed by the letter k, followed by anything until the end of the string. This would match values like "cook", "cookie" and "cake".

 

Exclude data that doesn't begin with an alphabetic character

Regular expression character classes are a powerful shortcut for matching types characters. For example:

  1. Include/Exclude: Exclude
  2. Match Type:: RegExp Match
  3. Value: ^[[:^alpha:]].*

The Edit Filter dialog for a filter called Exclude non-alpha characters, with the settings Exclude RegExp Match ^[["^alpha:]].* for the field 8 bit.

This will filter out non-alphabetic characters, such as Japanese kanji or Korean Hangul.

Understanding the regular expression: ^[[:^alpha:]].*

^ means "beginning of string"

[[:alpha:]] is the alphabetic [A-Za-z] character class. [[:^alpha:]] negates the class ("not alphabetic")

.* means "match anything"

Google RE2 regular expression syntax.

Was this helpful?

How can we improve it?
true
What's new in Looker Studio?

Learn about new features and recent changes. Looker Studio release notes live on Google Cloud.

Search
Clear search
Close search
Main menu
16799128213729250665
true
Search Help Center
true
true
true
true
true
102097
false
false