BEAST MODE NOT WORKING AS EXPECTED

BEAST MODE – AMOUNT LEFT

CASE WHEN (IFNULL(`RevisedEstimatedCost`,0)) >= (IFNULL(case when `SourceCode` = 'AP' then `TransactionAmt` end,0))

THEN (IFNULL(`RevisedEstimatedCost`,0)) - (IFNULL(case when `SourceCode` = 'AP' then `TransactionAmt` end,0))

ELSE

(IFNULL(case when `SourceCode` = 'AP' then `TransactionAmt` end,0)) - (IFNULL(case when `SourceCode` = 'AP' then `TransactionAmt` end,0))

END

Answers

  • @jtrollinger Can you share some more details on what specifically isn't working and what values you're expecting? Also is your data aggregated?

  • Beast Mode AmountLeft is calculated based on the 1st Case Statement Where if RevisedEstimatedCost is >= TransactionAmt then it is to perform the first calculation if not then it is to perform the second. Yes Data is aggregated in a Group BY in ETL