AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

Data Studio
2.4K members online now
2.4K members online now
Ask questions about Data Studio
Guide Me
star_border
Reply

Data Studio: Create an "OR" filter

[ Edited ]
Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

I want to create a chart with session metrics for 2 pages on my site. The filters work separately (e.g. page = /page1/  and page = /page2/). However, the data doesn't populate when both filters are applied to the report. How do I accomplish an "or" filter (e.g. page = /page1/ OR page = /page2/)?

1 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author Michalene B
September 2016

Re: Data Studio: Create an "OR" filter

Follower ✭ ✭ ☆
# 2
Follower ✭ ✭ ☆
You can likely accomplish this using a filter with the "Regex" match type, which would allow you to us regular expression to create the "OR" function you're after.

In Data Studio, go to the chart you are working on and navigate to the create filter option. Select the radio button "include", set your Dimension field to Page. Match type should be Regex. Then, in the expression field you can use the | character (pipe) , which in Regex means "OR".

For example, if I wanted to have a chart that showed sessions for example123.com/page1 and example123.com/page2 the expression would be "/page1|page2$" (without the quotes). This will only show pages that END in either /page1 OR /page2. The pipe (|) means "OR" and the dollar sign means "ends with".

When I was first getting started with Regex I found the guide Paul Koks over at Online Metrics put together really helpful: http://online-metrics.com/regular-expressions/

Hope that helps!

View solution in original post

Marked as Best Answer.
Solution
Accepted by topic author Michalene B
September 2016

Re: Data Studio: Create an "OR" filter

Follower ✭ ✭ ☆
# 2
Follower ✭ ✭ ☆
You can likely accomplish this using a filter with the "Regex" match type, which would allow you to us regular expression to create the "OR" function you're after.

In Data Studio, go to the chart you are working on and navigate to the create filter option. Select the radio button "include", set your Dimension field to Page. Match type should be Regex. Then, in the expression field you can use the | character (pipe) , which in Regex means "OR".

For example, if I wanted to have a chart that showed sessions for example123.com/page1 and example123.com/page2 the expression would be "/page1|page2$" (without the quotes). This will only show pages that END in either /page1 OR /page2. The pipe (|) means "OR" and the dollar sign means "ends with".

When I was first getting started with Regex I found the guide Paul Koks over at Online Metrics put together really helpful: http://online-metrics.com/regular-expressions/

Hope that helps!

Re: Data Studio: Create an "OR" filter

Top Contributor
# 3
Top Contributor

Hi @Michalene B - to add a filter which would include either A or B in terms of Sessions where a pageA or PageB happened - use the setup as in example:

 Screenshot_57.png

Please note that in your case place the character | between the pages you need inside the report. 

 

Hope it helps. 

 

Kind regards,

Zorin

 

 

Web analyst @ escapestudio.net