If-Then nested expression

I am looking to do a nested If-Then (new to coding, so I hope this is the corrrect term).
case when X = Y then
case when Z = A then B else C
end
else D end
Will this work in Phocus?