REGEXP_MATCH to find video length in a campaign name (DATA STUDIO)

208 Views Asked by At

I'm trying to create a new custom filed that matches the video length in a campaign name. The software I'm using is Google Data Studio.

For instance the campaign name I'm trying to match is the following:

367358_Reputation|CorporateReputation|Video|Awareness|DAN|NEST|MLT|CORP|IT|NP|ACQ|InStreamVideo|V1|it|LCL|DNP|NA|30s|16:9|mp4|Video|Ambiente|

I want to match "30s" and the code I'm writing in Data Studio is the following:

CASE
  WHEN REGEXP_MATCH(Campaign, "(.*30s.*)") THEN "Video length 30"
  ELSE NULL
END
1

There are 1 best solutions below

2
On

The REGEXP_MATCH function evaluates a field or expression using Google RE2 regular expression. Use the expression below

CASE WHEN REGEXP_MATCH(Campaign, ".*30s.*") THEN "Video length 30" END

PS: You also have a typo in your word REGEXP_MTACH should be REGEXP_MATCH