Data Studio
2.2K members online now
2.2K members online now
Ask questions about Data Studio
Guide Me
star_border
Reply

How do I make a dimension from word in a string?

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi

 

I have a adwords campaign name syntax that look something like this:

SE|MIX|DIS|RMKT|text|desktop_tablet|All_Visitors

 

From this campaign name I would like to make a dimension called Campaign type that looks if the campaign name has RMKT or PRSP in the string.

 

How do I do this in data studio?

In sql I would use "Like" so the function would look something like this:

 

Case

when campaign like '%RMKT%' then 'Remarketing'

when campaign like '%PRSP%' then 'Prospecting'

else 'other' end as campaign_type

 

 

 

How do I make a dimension from word in a string?

Explorer ✭ ✭ ✭
# 2
Explorer ✭ ✭ ✭

Hi @Tobias M

 

You may be able to do this with the REGEX_MATCH() function, more info here:

https://support.google.com/datastudio/answer/7064476?hl=en&ref_topic=7041728

 

Hope that helps,

Ben

 

 

How do I make a dimension from word in a string?

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Hi Ben,

 

Tried this but couldn't get it to work. Let me know if you could get it to work.

 

Thanks.

How do I make a dimension from word in a string?

Explorer ✭ ✭ ✭
# 4
Explorer ✭ ✭ ✭

Hi Tobias,

 

Could you share your formula and results vs. expected results?

 

Ben