AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

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

Trying to classify numbers with custom field using CASE

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi! I have a metric field of a lot of different numbers. I'm trying to create a dimension field where each metric is sorted into a category based on the number.

 

I'm trying to use the CASE function to create a custom field which does this. The formula I'm using is:

 

CASE 

WHEN 0 < Number <= 5 THEN “Tiny” 

WHEN 5 < Number <= 10 THEN “Small”

WHEN 10 < Number <= 15 THEN “Medium”

ELSE “Large”

END

 

using this https://support.google.com/datastudio/answer/7020724?authuser=4 as a reference.

However, it isn't parsing the formula, and when I paste it into the custom field formula section, only the first 'WHEN' and 'THEN' are recognized as functions.

 

Any help would be great!