# How can calculate run hour machine?

**URL:** <https://forum.inductiveautomation.com/t/how-can-calculate-run-hour-machine/32702>\
**Category:** Ignition\
**Created:** [February 28, 2020, 5:49pm UTC](https://forum.inductiveautomation.com/t/how-can-calculate-run-hour-machine/32702 "2020-02-28T17:49:16Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 28, 2020, 6:37pm UTC](https://forum.inductiveautomation.com/t/how-can-calculate-run-hour-machine/32702/6 "2020-02-28T18:37:06Z")

</div>

Consider making a boolean expression tag that is true when the first tag is \>= 10. Then record in your DB whenever it changes. Then you can calculate from the DB. See also:

> [@Not sure if I'm using an hour meter transaction group properly](http://forum.inductiveautomation.com/t/not-sure-if-im-using-an-hour-meter-transaction-group-properly/32578/5):
>
> If you want to be precise, record every transition of your “Running” status in a table with a timestamp. Perform delta calculations from event to event, summing the deltas that are “true” at the start. (The lead() and lag() window aggregate functions in SQL are the most efficient means to do this, imnsho.) Clip the deltas to specific time periods to summarize by hour/shift/day/week/whatever.

---

_[View the full topic](https://forum.inductiveautomation.com/t/how-can-calculate-run-hour-machine/32702)._
