This content is likely not relevant anymore. Try searching or browse recent questions.
Filters & Logical Order of Operations 0 Recommended Answers 1 Reply 0 Upvotes
1 Recommended Answer
$0 Recommended Answers
Last edited 6/12/19
I am attempting to set up a filter in the format A OR (B AND C) - meaning I want all records meeting criterion A OR all records meeting both criteria B AND C.  Is there a way to do this in Data Studio?  When I attempt to set it up, it seems to give the results for (A OR B) AND C, which is different, and I can't find a method of adding parenthesis or otherwise forcing order of operations.   

Basically, I want to filter for all records that start with "Apple" OR all records that start with "Orange" AND contain "Juice" so that the data set:

"Apple Cider"
"Orange Soda"
"Orange Juice"

would return these records:

"Apple Cider"
"Orange Juice"

because they start with "Apple" OR (start with "Orange" AND contain "Juice")

But the filter structure in Data Studio seems to only allow the order of operations that would result in:

"Orange Juice" 

because it starts with ("Apple" OR "Orange") AND contains "Juice"

Obviously this is not my real data set, it is just an example of the difference between A OR (B AND C) versus (A OR B) AND C.  I need to accomplish the A OR (B AND C) order of operations, not apply a mish-mash of filters to achieve the two beverages in the desired list above, which could be done by simply excluding records containing "Soda."
All Replies (1)
Hey Data AHV

Alternatively, you could use a calculated field:

REGEXP_EXTRACT(Beverage,"(^Apple.*|^Orange Juice$)")

Links below for further clarification:
marked this as an answer
This question is locked and replying has been disabled.
Discard post? You will lose what you have written so far.
Write a reply
10 characters required
Failed to attach file, click here to try again.
Discard post?
You will lose what you have written so far.
Personal information found

We found the following personal information in your message:

This information will be visible to anyone who visits or subscribes to notifications for this post. Are you sure you want to continue?

A problem occurred. Please try again.
Create Reply
Edit Reply
Delete post?
This will remove the reply from the Answers section.
Notifications are off
Your notifications are currently off and you won't receive subscription updates. To turn them on, go to Notifications preferences on your Profile page.
Report abuse
Google takes abuse of its services very seriously. We're committed to dealing with such abuse according to the laws in your country of residence. When you submit a report, we'll investigate it and take the appropriate action. We'll get back to you only if we require additional details or have more information to share.

Go to the Legal Help page to request content changes for legal reasons.

Reported post for abuse
Unable to send report.
This reply is no longer available.
You'll receive email notifications for new posts at
Unable to delete question.
Unable to update vote.
Unable to update subscription.
You have been unsubscribed
Unable to delete reply.
Removed from Answers
Marked as Recommended Answer
Removed recommendation
Unable to update reply.
Unable to update vote.
Thank you. Your response was recorded.
Unable to undo vote.
Thank you. This reply will now display in the answers section.
Link copied
Unable to lock
Unable to unlock
Unable to pin
Unable to unpin
Unable to mark
Reported as off topic