L
L
latyshevstanislav2019-10-30 13:49:55
Regular Expressions
latyshevstanislav, 2019-10-30 13:49:55

How to set up calculated fields in Google Data Studio?

You need to create an indicator in which the field and expression are:
1. “Campaign”,*(NAME_COUNTRY).*
2. REGEXP_MATCH(Source or channel, '.*(google / cpc).*') Figured
out number 1:
CASE
WHEN REGEXP_MATCH(Campaign,'.*(Russia|England|Germany|France).*') THEN “EUROPE”
WHEN REGEXP_MATCH(Campaign,'.*(US).*') THEN “NORTH. AMERICA”
ELSE “Others”
END
And here is how to add condition number 2…
UPD #1: I don't know how to nest another CASE
UPD #2: I tried to add an AND operator like this:
CASE
WHEN REGEXP_MATCH(Campaign,'.*(russia| germany|france|england).*') AND REGEXP_MATCH(Source or channel,'.*(google / cpc).*') THEN “EUROPE”
WHEN REGEXP_MATCH(Campaign,'.*(us).*') AND REGEXP_MATCH(Source or feed,'.*(google / cpc).*') AMERICA”
ELSE “Other”
END
With this option, the data in the “Other” category got out
And if you apply a filter in the report on the traffic source I need, everything is OK
How to be?)))
Thank you in advance

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question