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

unable to add a new CASE WHEN calculated field in Data Studio

[ Edited ]
Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

I'm trying to add a new CASE WHEN calculated field to my data source, but no matter what I do I get the "Invalid formula." error.  Here's what I tried so far:

  • creating a new calculated field from scratch (obviously)
  • copying/pasting an existing calculated field from the same data source with a CASE WHEN statement that's currently working
  • copying/pasting CASE WHEN statements from the Help document and inserting my field name

Here's a short video so y'all can see what I'm seeing: LINK

 

Here are all the statements that failed:

CASE WHEN AO2 = "Proficient" THEN 4 ELSE 0 END

 

CASE WHEN EC = "Proficient" THEN 4 WHEN EC = "Minimally Effective" THEN 3 WHEN EC = "Developing" THEN 2 ELSE 0 END

 

CASE WHEN AO2 IS NULL THEN 10 ELSE 20 END

 

CASE WHEN AO2 IS NULL THEN "10" ELSE "20" END

 

CASE WHEN AO2 IS NULL THEN '10' ELSE '20' END

 

The data source is a Google Sheet that's linked to a Google Form, in case that makes a difference.  Any help is greatly appreciated.  Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author Ranjeet S
December 2016

unable to add a new CASE WHEN calculated field in Data Studio

Visitor ✭ ✭ ✭
# 2
Visitor ✭ ✭ ✭

Not sure what happened, but I just tried again and it worked.  Basically same code as above:

 

CASE WHEN AO2 = "Developing" THEN 2 WHEN AO2 = "Minimally Effective" THEN 3 WHEN AO2 = "Proficient" THEN 4 ELSE 0 END

View solution in original post

Marked as Best Answer.
Solution
Accepted by topic author Ranjeet S
December 2016

unable to add a new CASE WHEN calculated field in Data Studio

Visitor ✭ ✭ ✭
# 2
Visitor ✭ ✭ ✭

Not sure what happened, but I just tried again and it worked.  Basically same code as above:

 

CASE WHEN AO2 = "Developing" THEN 2 WHEN AO2 = "Minimally Effective" THEN 3 WHEN AO2 = "Proficient" THEN 4 ELSE 0 END