The following SQL returns Query plan error:

SELECT
SELECT value = CASE -- (Level 1)
WHEN (SELECT VALUE = CASE -- (Level 2)
WHEN (SELECT Value = CASE -- (Level 3)
WHEN IsNull((Round(Cast(2 AS Float),6)), 0)
> IsNull((Round(Cast(1 AS Float),6)), 0)

THEN 'Y' ELSE 'N' END)
= 'Y'
THEN ( IsNull((Round(Cast(1 AS Float),6)), 0) )
ELSE( IsNull((Round(Cast(-1 AS Float),6)), 0) )
END)
>= -10 AND

(SELECT VALUE = CASE
WHEN (SELECT Value = CASE
WHEN IsNull((Round(Cast(2 AS Float),6)), 0)
> IsNull((Round(Cast(1 AS Float),6)), 0)

THEN 'Y' ELSE 'N' END)
= 'Y'
THEN ( IsNull((Round(Cast(1 AS Float),6)), 0) )
ELSE( IsNull((Round(Cast(-1 AS Float),6)), 0) )
END)
<= 10
THEN
(SELECT VALUE = CASE
WHEN (SELECT Value = CASE
WHEN IsNull((Round(Cast(2 AS Float),6)), 0)
> IsNull((Round(Cast(1 AS Float),6)), 0)

THEN 'Y' ELSE 'N' END)
= 'Y'
THEN ( IsNull((Round(Cast(1 AS Float),6)), 0) )
ELSE( IsNull((Round(Cast(-1 AS Float),6)), 0) )
END)
ELSE 0 END)

AS FormulaValue


The workaround I had was: To collapse Level 2/Level 3
(Passing Level 2 (THEN and ELSE) values to Level 3 (THEN
and ELSE), in other words, replacing 'Y' and 'N' of
Level 3 with THEN and ELSE values of Level 2)

If you find a solution or a better workaround, I will
appreciate your reply at "chikkuvarma@cs.com".