Solved

Multiple case statements in Advanced Formula?

  • 6 March 2018
  • 1 reply
  • 86 views

Userlevel 7
Badge +2
I am trying to leverage an Advanced Formula in Data Management and where I have successfully used them before for IF-THEN-ELSE type scenarios, does anyone know if you can do IF-THEN-ELSIF-THEN-ELSE type scenarios?

I tried 

case when (X < Y and X is not null) then 0 else (X > Y and X < Z) then 50 else (X > Z) 100 end

That didn't work (neither did removing the brackets) so I'm thinking either my syntax is bad or this is not possible.  Any feedback?
icon

Best answer by darkknight 7 March 2018, 04:47

Figured this out with a little help from Gainsight:



case when X < Y then 0 when (X > Y and X < Z) then 50 else 100 end



Looks like you go straight into a "when" statement after the first value option. Not need for a "then" 



And just tie it off with an "else # end"
View original

1 reply

Userlevel 7
Badge +2
Figured this out with a little help from Gainsight:

case when X < Y then 0 when (X > Y and X < Z) then 50 else 100 end

Looks like you go straight into a "when" statement after the first value option. Not need for a "then" 

And just tie it off with an "else # end"

Reply