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

CASE formula not working with multiple WHEN Statements

Follower ✭ ☆ ☆
# 1
Follower ✭ ☆ ☆

Hi All,

 

Trying to use multiple WHEN statements in the same calculated field, but it seems to break the formula. Here is the statement:

 

CASE WHEN REGEXP_MATCH(Medium, '((s|S)ocial-paid)')AND REGEXP_MATCH(Bron, '((f|F)acebook|instagram)') THEN 'Social Paid' WHEN REGEXP_MATCH(Medium, '(display$|cpc)')AND REGEXP_MATCH(Campagne, '(.*7(\.| ).*|.*8(\.| ).*)') THEN 'Display Prospecting' WHEN REGEXP_MATCH(Medium, '(display)') AND REGEXP_MATCH(Bron, '(.*criteo.*)') THEN 'Display Retargeting' ELSE 'Other Channel' END

 

Can anyone help me out with this one. I appear to be stuck.

 

Thanks in advance!

CASE formula not working with multiple WHEN Statements

Follower ✭ ☆ ☆
# 2
Follower ✭ ☆ ☆

Try to not use the AND (and OR) statements. 
Instead of AND you can just define them in the right order, because the CASE statement will be executed from start to end.