Beastmode calculation

(CASE WHEN `Current Month`='Y' THEN SUM(`Monthly HC Calculated`) END) - (CASE WHEN `Prior Month`='Y' THEN SUM(`Monthly HC Calculated`) END)


correct one.. but output is zero. we are subtract Current month vs previous month column

might be null value is there so there is no output.. pls check what i am missing.

Answers

  • Hi @RajNadar, the expected result, from the above calculations, won't come as 'beast modes' are calculated on a row basis. With this beast, either there will be values from current month or previous month but won't have both captured. As a result, you'll have a value and NULL per row and also subtracting null from anything will give null, resulting in a blank output.

    Using Window functions are one option to look into for your calculations, whether it's through Analyser or ETL.

  • i tried something coming as NULL Value so calculation not working then how to overcome

    if null make it zero then do this calculation.