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

Demo of calculated field doesn't work for me

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hello,

 

I have see this content : 

https://support.google.com/360suite/datastudio/answer/6299685?hl=en&ref_topic=6370331

 

In the video, we've got this calculated expression :

CASE WHEN REGEXP_MATCH( Pays , "(United States|Canada|Mexico)") THEN "Europe" ELSE "Rest of world" END

 

I try it and google data studio tel me :

Invalid formula.

 

Could you help me ?

 

Thanks

Demo of calculated field doesn't work for me

Explorer ✭ ✭ ✭
# 2
Explorer ✭ ✭ ✭

Hi Laurent,

 

Your formula looks fine, are you certain you are referencing a dimension that exists in your data? e.g. 'Pays'

 

Ben

Demo of calculated field doesn't work for me

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Hi Ben,

 

The tools are autocomplete this term. It's the traduction of Country.

I have test with country but it say than it doesn't exist. 

I suppose than it's a controle between my field name and i'm in french language.

 

For you, this test is works ?

 

Thanks

Demo of calculated field doesn't work for me

Follower ✭ ✭ ✭
# 4
Follower ✭ ✭ ✭

If you add, as a temporary test measure, a simple table with "Pays" as one of the columns, you can check what the data in that field looks like.

 

One other thing, you need to be careful with separating the different parts of the "case" with spaces. If you write this in several lines in a text editor, and then paste it, Data Studio will strip the line breaks but not add "spaces" instead, making the parts go together and be unrecognizable for Data Studio. 

Demo of calculated field doesn't work for me

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭

Hi Laurent,

I have the exact same problem. Did you manage to solve it?
Thanks,