I Love the SIGN function...
CASE WHEN fsq.SalesAmountQuota > frs.SalesAmount
THEN 1 ELSE CASE WHEN fsq.SalesAmountQuota = frs.SalesAmount
THEN 0 ELSE -1 END
END as Trend
Can be replaced with:
SIGN(fsq.SalesAmountQuota - frs.SalesAmount) as Trend
IMNSOH, I think it is simpler 🙂