Supermetrics Support Forum

Filter results by a field containing punctuation marks

In case you have punctuation marks in the field used in the Filter Control object, you might encounter NO DATA error in the result. This is due to punctuation marks interfering how the code handles the request.

In these occasions you can use Data Studio built in feature, Calculated fields with the REGEX_REPLACE function. This will eliminate any interfering characters from the request and the query is able to return the filtered results.

More information on calculated fields here

Example 1: Exclude commas from the value filter

Formula REGEXP_REPLACE(Campaign name,"[,]","")

Example 2: Exclude parentheses/brackets from the value filter

Formula REGEXP_REPLACE(Campaign name,"[[]|[]]|[(]|[)]","")

For more advanced regular expressions you can check the validity with tools like to ensure functionality on your Data Studio dashboard.

Note! In case Data Studio prompts an error for illegal escape sequence (Syntax error: Illegal escape sequence: \s.), although you validated the expression, please add one more backslash { \ } to the statement e.g. REGEXP_EXTRACT(Campaign name,'^([^\\s]+)'). Reference for Google RE2

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.