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

Custom Channel Grouping in Calculated Fields - Does Not work with AND operator

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hello guys,

 

I would like to ask whether data-studio is able to accept AND or OR operator within when clause.

 

I am trying to add custom channel grouping in data-studio via calculated fields but it seems that it does not count or understand the logic.

 

When i make simple custom channel like Medium = "cpc" THEN "Paid" it works.

 

Example from my dashboard: This works

CASE WHEN (REGEXP_MATCH(Campaign, '.*something.*')) THEN "something" WHEN Default Channel Grouping = "Direct" THEN "Direct" ELSE "Other" END

 

But when I make more complex channel with several conditions like this it does not work.

 

Moreover the functions like THEN and ELSE are greyed after the AND or OR operator 

 

CASE WHEN (REGEXP_MATCH(Campaign, '.*something.*')) AND Medium = "anything" AND Source = "any source" AND Campaign = "any campaign" THEN "some paid search non brand" ELSE = "Other" END

 

I tried it also without REGEXP_MATCH and am kind of sure the formula is OK as well as conditions of the channel. But never say never :-)

 

Am i doing something wrong or is there any other issue?

 

Thank you for any feedback!

 

with best regards Mayo

Custom Channel Grouping in Calculated Fields - Does Not work with AND operator

Follower ✭ ✭ ☆
# 2
Follower ✭ ✭ ☆

Hi Mayo,

 

I believe the formula should work. I myself have used Custom Channel Grouping as calculated metrics mainly using OR function but it should not matter. It works well on my end.

 

What was the error message? Was it showing "Invalid formula" or wrong result? 

 

 

Custom Channel Grouping in Calculated Fields - Does Not work with AND operator

Follower ✭ ✭ ☆
# 3
Follower ✭ ✭ ☆

Hello,

 

 

The issue is on your ELSE part:

ELSE "Other"

not ELSE ="Other"

 

:-)

 

Regards

 

Pierre Damien