Prerequisites
When creating a filter on a chart, you can add AND/OR
conditions. However, once you've added more than 10 OR
conditions, you cannot add any more OR
clauses unless you create a new AND
condition.
There are a few ways to work around this limitation:
Update the filter conditions to another type
One way to work around this limit is to change your filter conditions to a more inclusive filter type.
For example, if you want a field to match 11 possible values, you can use the IN
filter type and list each of those values.
As another example, consider a field with product names. You want to create a filter that returns all products that start with the 12 letters A-L. You can achieve this with a RegExp Match type filter by using the appropriate regular expression syntax. In this example, the syntax would be the following: REGEXP_MATCH(field, "^[A-L].*")
Move the filter conditions into a new field
Another workaround is to move the conditions into a separate calculated field and filter on that new field. Calculated fields don't have the same limit on the number of logical conditions that can be included.
For example, let's say you have 11 different fields, and you want to create a filter that checks if any of them contains a specific error string.
You can create a new field that has the 11 OR conditions that you'd need to check this condition. The formula would look like this example:
CONTAINS_TEXT(log_field_1, "error")
OR
CONTAINS_TEXT(log_field_2, "error")
OR
CONTAINS_TEXT(log_field_3, "error")
OR
CONTAINS_TEXT(log_field_4, "error")
OR
CONTAINS_TEXT(log_field_5, "error")
OR
CONTAINS_TEXT(log_field_6, "error")
OR
CONTAINS_TEXT(log_field_7, "error")
OR
CONTAINS_TEXT(log_field_8, "error")
OR
CONTAINS_TEXT(log_field_9, "error")
OR
CONTAINS_TEXT(log_field_10, "error")
OR
CONTAINS_TEXT(log_field_11, "error")
This formula field will create a Boolean field type, which evaluates to True
or False
.
Finally, create a filter that filters on this new field being True
.