# Preventing divide by 0 in reports

**URL:** <https://forum.inductiveautomation.com/t/preventing-divide-by-0-in-reports/6040>\
**Category:** Ignition\
**Created:** [March 15, 2013, 8:21pm UTC](https://forum.inductiveautomation.com/t/preventing-divide-by-0-in-reports/6040 "2013-03-15T20:21:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Curlyandshemp](https://avatars.discourse-cdn.com/v4/letter/c/bcef8e/32.png) [@Curlyandshemp](https://forum.inductiveautomation.com/u/Curlyandshemp)\
**Post date:** [March 15, 2013, 8:21pm UTC](https://forum.inductiveautomation.com/t/preventing-divide-by-0-in-reports/6040/1 "2013-03-15T20:21:17Z")

</div>

I am having an issue with a calculated value in a report. It is a calc based on running totals of a shift. Whenever the equipment is not running, all totals are 0s and one of the calculations ends up being 0/0 which causes infinitey to show on the reports.

How to prevent this or force a 0 ?

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/3/3145059c74cd1b2dc961d27bfd15260b9df5c4e4.jpg)  
  
 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/7/70258e4c4d3c8404b8957a0eef3f19adb189da34.jpg)

---

<div class="post-metadata">

**Author:** ![Curlyandshemp](https://avatars.discourse-cdn.com/v4/letter/c/bcef8e/32.png) [@Curlyandshemp](https://forum.inductiveautomation.com/u/Curlyandshemp)\
**Post date:** [March 15, 2013, 10:15pm UTC](https://forum.inductiveautomation.com/t/preventing-divide-by-0-in-reports/6040/2 "2013-03-15T22:15:39Z")

</div>

as a quick fix, I added 0.001 to the divisor as this # is usually quite large and an addition 0.001 will not effect accuracy, and problem resolved, calculation now results in 0.00  
 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/2/2a87cc9d173c8d8e91d3a50f85496d6c8f509b47.jpg)

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [March 18, 2013, 8:58pm UTC](https://forum.inductiveautomation.com/t/preventing-divide-by-0-in-reports/6040/3 "2013-03-18T20:58:46Z")

</div>

You can also do something like this in the report:`@Shift1.total.Patent_B+Shift1.total.Clears_B = 0 ? 0 : (((Shift1.total.Wheat_to_Roll_B/60) / (Shift1.total.Patent_B+Shift1.total.Clears_B)) * 100)`I know it is more complicated.
