Solved

Divide by zero error

Posted on 2014-01-13
2
411 Views
Last Modified: 2014-01-13
I have a formula that on certain items will cause a divide by zero error.  I need to figure out how to get past this and not calculate the formula if there is a zero.

({XFGMULTI.NEW_QUAN} / {@perpetual}) * 100
0
Comment
Question by:delta1734
2 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
Comment Utility
You need to test for the 0 divisor before dividing

Try this
If  {@perpetual} = 0 then
    0
Else
    ({XFGMULTI.NEW_QUAN} / {@perpetual}) * 100 

Open in new window


You can have it return any value if it is 0

If you want it to be blank then

If  {@perpetual} <> 0 then
     ({XFGMULTI.NEW_QUAN} / {@perpetual}) * 100 

Open in new window


mlmcc
0
 

Author Closing Comment

by:delta1734
Comment Utility
The first example was exactly what I needed.  Thanks!
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now