Puoi sempre usare un CTE per astrarre le cose a un livello diverso, se questo aiuta - qualcosa sulla falsariga di ...
With CTE as
(
SELECT
CASE column1
WHEN something THEN 10
ELSE 20
END AS newcol1,
CASE column12
WHEN something THEN 30
ELSE 40
END AS newcol2,
column3,
FROM table
)
SELECT
newcol1, newcol2,
count(column3) as newcol3,
(newcol2 * newcol3) AS newcol4
FROM CTE
GROUP BY newcol1,newcol2,newcol3