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

CASE formula not working

Follower ✭ ☆ ☆
# 1
Follower ✭ ☆ ☆

Hi all

 

Currently having issues with creating a new dimension using the CASE formula. Here is my formula:

 

CASE WHEN REGEXP_MATCH(Event Action, "camera|Camera") THEN "Camera" ELSE "OTHER" END

 

In my event action data I have the following:

 

 

share::social::com.apple.UIKit.activity.SaveToCameraRoll

 

All that is returned is "OTHER" data. 

 

I've tried the above CASE formula with and without brackets. I've tried pasting it into CASE formulae where they already work but using other words in the REGEX. Not sure where I'm going wrong, if anyone can help that would be much appreciated

 

Thanks

Aaron

1 Expert replyverified_user

CASE formula not working

Top Contributor
# 2
Top Contributor

Hi @Aaron H try using .*camera.*.

 

Kind regards,

Zorin

 

Web analyst @ escapestudio.net

CASE formula not working

Follower ✭ ☆ ☆
# 3
Follower ✭ ☆ ☆

Thanks Zorin but unfortunately it's still just returning "OTHER"

 

CASE formula not working

Follower ✭ ☆ ☆
# 4
Follower ✭ ☆ ☆

Just been playing with some things. If I put the whole event action string in (which obviously defeats the point of using regex) it works. So it must be something wrong with the regex expression - is it because of the character is the string e.g. : and . ?

 

 

 

CASE formula not working

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭

Hi Aaron, 

 

Can you explicit the formula you finally put ?

I have problem making work mine .

See this topic: https://www.en.advertisercommunity.com/t5/Data-Studio/Invalid-formula-on-CASE-WHEN/td-p/872752

 

Thx!