Beast Mode Not Working when a Value is ZERO
I have a Beast Mode that is not Calculating when one of the Values is ZERO.
In this example Projected Cost Should be 21,192 based on the Beast Mode Equation but instead is returning a ZERO Value.
BEAST MODE BELOW
/Projected Actual Cost is equal to the Greater of Revised Estimated Cost or Job To Date Cost/
CASE WHEN SUM(MAX(IFNULL(RevisedEstimatedCost
,0)) FIXED (BY job4
, CostTypeWK
,CostCode_WK
, VendorNo
)) >= SUM(case when SourceCode
!= 'CO' then TransactionAmt
end)
THEN SUM(MAX(IFNULL(`RevisedEstimatedCost`,0)) FIXED (BY `job4`, `CostTypeWK`,`CostCode_WK`,
`VendorNo`))
ELSE SUM(IFNULL(case when `SourceCode` != 'CO' then `TransactionAmt` end,0))
END
Answers
-
@jtrollinger Is SourceCode = CO in the rows in question? It likely has to do with your last IFNULL forcing the output to zero
0 -
Try breaking down your problem into smaller portions to see where it's failing, create 2 separate beast modes and display them in your table, one for the portion that the FIXED function is calculated, and another for the other one and see if each one is returning what you expect or not.
SUM(MAX(IFNULL(RevisedEstimatedCost,0)) FIXED (BY job4, CostTypeWK,CostCode_WK, VendorNo))
and
SUM(IFNULL(case when `SourceCode` != 'CO' then `TransactionAmt` end,0))
If both of them are working, I do see that in your CASE statement, the logic comparison does not wraps the second part with IFNULL. It is odd that you'll need to have a fixed function for one of the elements to compare while the other is just a standard aggregation one, but it all depends on what your data structure looks like.
0 -
I figured it out. the IFNULL is required for the formula to work I just forgot to put it on
SUM(case when
SourceCode
!= 'CO' thenTransactionAmt
end)in the first part of the equation.
0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 616 Datasets
- 2.2K Magic ETL
- 3.8K Visualize
- 2.5K Charting
- 738 Beast Mode
- 56 App Studio
- 40 Variables
- 684 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 46 Workflows
- 10 DomoAI
- 36 Predict
- 15 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 123 Manage
- 120 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive