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

Case statement not working

Participant ✭ ✭ ☆
# 1
Participant ✭ ✭ ☆

I'm trying to create a field for fiscal year, which starts in October. Here's what I've tried:

 

CASE WHEN month<10 THEN year ELSE year+1 

CASE WHEN month<10 THEN year ELSE year+1 END

CASE WHEN (month<10) THEN year ELSE (year+1) END

=CASE WHEN month<10 THEN year ELSE year+1 END

 

Nothing works. I think there's something amiss with the year+1 section because I tried creating a dimension that was simply year+1 and that didn't work either. 

 

I also tried something really simple that didn't work either:

 

CASE WHEN 1-1 THEN 2 ELSE 3 END (also tried without the else 3)

 

What am I doing wrong? 

Case statement not working

Follower ✭ ✭ ✭
# 2
Follower ✭ ✭ ✭

I've not got Case statements and metrics to work, only dimensions. 1-1 is truely a metric.

Case statement not working

Participant ✭ ✭ ☆
# 3
Participant ✭ ✭ ☆

Actually, what I'm trying to do is a dimension. It has math in it, but it's a time dimension to calculate the fiscal year from the calendar year.