0

I have a data studio report built that needs some filtering added in, the filters are based on what type of adwords campaign there are.

The shopping ads are determined by the campaign name having the word shopping in it. Anything which does not have the word shopping is considered a search or text ad.

I know it is a case statement of some sort, which used the campaign name field, I just cannot get it right.

The expected output would be 2 filters, one called "Shopping" which is all shopping ads, the other would be "Search". All campaigns would come under one of the 2 options

1 Answers1

0
CASE WHEN REGEXP_MATCH(campaignName, '.*shopping.*') THEN 'Shopping Ad'
ELSE 'Search Ad' END

this is assuming that your campaign name field is called campaignName. It also is case sensitive. You are supposed to be able to put (?i) at the beginning of the expression to flag case insensitivity, but Data Studio is very finicky, and the documentation and error messages aren't very good. I would try it and see if it works, although you have probably moved on by now.

Chris Strickland
  • 3,388
  • 1
  • 16
  • 18