I have a lots of calculated columns and they keep repeting themselves, one inside of the others, including nested cases statements.
There is a really simplified ver
Another option if someone is still interested:
with aa(a) as ( select 1+2 ) , bb(b) as ( select a+3 from aa ) ,cc(c) as ( select b*7 from bb) SELECT aa.a, bb.b, cc.c from aa,bb,cc