BEAST MODE NOT WORKING AS EXPECTED

Options

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

  • MichelleH
    Options

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

  • jtrollinger
    Options

    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