AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

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

Display multiple names as one

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Our company had run multiple Facebook campaigns in October 2016 for 2 products.

 

Each campaign has a different name, but contains the original product name in it.


Example:

 

CANDY CANE Big Facebook Campaign (Product 1)

CANDY CANE Small Facebook Campaign (Product 1)

CANDY CANE Facebook Quick Blast (Product 1)

HOT CHOCOLATE Facebook Big Campaign (Product 2)

HOT CHOCOLATE Facebook Big Campaign (Product 2)

 

How would I get Candy Cane as 1 line instead of 3 (and all data be combined thats associated with it), and Hot Chocolate as 1 line instead of 2?

 

Thank you in advanced Smiley Happy

1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author Stephanie C
June 2017

Display multiple names as one

Follower ✭ ✭ ☆
# 3
Follower ✭ ✭ ☆

Hi Stephanie,

 

you just have to create a Custom Dimension that transforms your campaign names into categories.

 

As Mike mentioned, in your new Custom Dimension you need to use a CASE statement.

 

I'd suggest to make use of the REGEXP_MATCH function (Google RE2 regular expression syntax) inside your WHEN conditions. This function returns true if the regex has a match in your campaign name.

 

Example:

 

CASE

  WHEN REGEXP_MATCH(Campaign name, 'CANDY CANE .*') THEN "CANDY CANE" 

  WHEN REGEXP_MATCH(Campaign name, 'HOT CHOCOLATE .*') THEN "HOT CHOCOLATE" 

ELSE Campaign name

END 

 

Campaign name needs to be replaced by your actual source Dimension.

 

If the Campaign name neither starts with CANDY CANE nor with HOT CHOCOLATE, the actual Campaign name will be listed (ELSE result).

 

Good luck!

View solution in original post

Display multiple names as one

Participant ✭ ☆ ☆
# 2
Participant ✭ ☆ ☆

You could go about this using a CASE statement to do the grouping.

 

https://support.google.com/datastudio/answer/7020724?hl=en

Marked as Best Answer.
Solution
Accepted by topic author Stephanie C
June 2017

Display multiple names as one

Follower ✭ ✭ ☆
# 3
Follower ✭ ✭ ☆

Hi Stephanie,

 

you just have to create a Custom Dimension that transforms your campaign names into categories.

 

As Mike mentioned, in your new Custom Dimension you need to use a CASE statement.

 

I'd suggest to make use of the REGEXP_MATCH function (Google RE2 regular expression syntax) inside your WHEN conditions. This function returns true if the regex has a match in your campaign name.

 

Example:

 

CASE

  WHEN REGEXP_MATCH(Campaign name, 'CANDY CANE .*') THEN "CANDY CANE" 

  WHEN REGEXP_MATCH(Campaign name, 'HOT CHOCOLATE .*') THEN "HOT CHOCOLATE" 

ELSE Campaign name

END 

 

Campaign name needs to be replaced by your actual source Dimension.

 

If the Campaign name neither starts with CANDY CANE nor with HOT CHOCOLATE, the actual Campaign name will be listed (ELSE result).

 

Good luck!

Display multiple names as one

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭

Wonderful, extremely helpful. Thank you so much for your time!

Display multiple names as one

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭

Thank you very much Smiley Happy