Beast Mode error message (dividing by zero)
We're trying to find the variance of Actual from Forecasted but running into the Zero Division issue; read a few other threads, all of which were far more involved Beast Mode formulas, and tried as best I could to adapt those formulas to our situation but having trouble getting it to work - any help would be greatly appreciated!
Original Beast Mode Calculation (validated fine but obviously returned an error message when the Beast Mode was saved: You have a divide by zero error in your Card’s Beast Mode)
SUM(`Actual Call Volume`) / SUM(`Forecasted Call Volume`)
After reading other threads tried several possible solutions and thought this made the most sense, and seemed straightforward but can't get it to validate & not sure what needs to be corrected:
CASE
WHEN SUM(`Forecasted Call Volume`) = 0
THEN 'No Variance'
ELSE
SUM(`Actual Call Volume`) / SUM(`Forecasted Call Volume`)
The above formula was tried with several variances as well and still no luck. Any thoughts on what we're missing here? If additional information is required, please don't hesitate to ask and thank you in advance for your time & assistance!
Best Answers
-
I think the problem is if the case statement is true, you're returning a string but when it's false, you have it returning a number. they need to be the same.
Domo Arigato!
**Say 'Thanks' by clicking the thumbs up in the post that helped you.
**Please mark the post that solves your problem as 'Accepted Solution'2 -
Hi,
I think @Godzilla is right.
Another way to tackle this would be :
SUM(`Actual Call Volume`) / NULLIF(SUM(`Forecasted Call Volume`),0)
Hope this helps.
Ricardo Granada
MajorDomo@Lusiaves
**If the post solves your problem, mark it by clicking on "Accept as Solution"
**You can say "Thank you" by clicking the thumbs up in the post that helped you.4
Answers
-
I think the problem is if the case statement is true, you're returning a string but when it's false, you have it returning a number. they need to be the same.
Domo Arigato!
**Say 'Thanks' by clicking the thumbs up in the post that helped you.
**Please mark the post that solves your problem as 'Accepted Solution'2 -
Hi,
I think @Godzilla is right.
Another way to tackle this would be :
SUM(`Actual Call Volume`) / NULLIF(SUM(`Forecasted Call Volume`),0)
Hope this helps.
Ricardo Granada
MajorDomo@Lusiaves
**If the post solves your problem, mark it by clicking on "Accept as Solution"
**You can say "Thank you" by clicking the thumbs up in the post that helped you.4 -
@Godzilla, tried to change 'No Variance' to '' (empty single quotes) as well as '0' (numeric) to make it so both returned a numeric value rather than a string & numeric value, but neither worked.
@RGranada, your alternate solution worked perfectly, thank you for that!
Once last question: by removing No Variance and keeping an empty single quotes, or placing a zero in between, in theory wouldn't at least one of those options have worked to make the formula valid?
You guys are always so helpful, and very quick to reply and it's greatly appreciated!
0 -
I believe since you kept the single quotes around the 0, i think it still treated the vaue as a string. For numeric values, you do not need any quotation around them.
Domo Arigato!
**Say 'Thanks' by clicking the thumbs up in the post that helped you.
**Please mark the post that solves your problem as 'Accepted Solution'0 -
Thanks for the clarification, @Godzilla, much appreciated!
0 -
I got the same error "dividing by zero"
Here is my simple formula
DIV(`ItemBill`,`ItemPay`)
I event tried
ItemBill`/`ItemPay
Both formulas I got the same error. Could someone help?
0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.6K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 102 SQL DataFlows
- 626 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 753 Beast Mode
- 61 App Studio
- 41 Variables
- 692 Automate
- 177 Apps
- 456 APIs & Domo Developer
- 49 Workflows
- 10 DomoAI
- 38 Predict
- 16 Jupyter Workspaces
- 22 R & Python Tiles
- 398 Distribute
- 115 Domo Everywhere
- 276 Scheduled Reports
- 7 Software Integrations
- 130 Manage
- 127 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 11 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 110 Community Announcements
- 4.8K Archive