# "Totalizer" for a historical value

**URL:** <https://forum.inductiveautomation.com/t/totalizer-for-a-historical-value/37014>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [July 23, 2020, 6:38pm UTC](https://forum.inductiveautomation.com/t/totalizer-for-a-historical-value/37014 "2020-07-23T18:38:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![scott.stamps](https://avatars.discourse-cdn.com/v4/letter/s/ba9def/32.png) [@scott.stamps](https://forum.inductiveautomation.com/u/scott.stamps)\
**Post date:** [July 23, 2020, 6:38pm UTC](https://forum.inductiveautomation.com/t/totalizer-for-a-historical-value/37014/1 "2020-07-23T18:38:08Z")

</div>

All - we are needing to build a “totalizer” for a historical tag. I’ve been told that this can be done with an Expression Tag, but I am new to the Ignition platform so, if there’s a better method, I’m open.

Basically, we have a boolean tag, MACHINE\_IS\_RUNNING, which has history enabled. What we would like to determine is total machine run time.

Hope that’s enough info.

Thanks

---

<div class="post-metadata">

**Author:** ![dan123](https://avatars.discourse-cdn.com/v4/letter/d/cc9497/32.png) [@dan123](https://forum.inductiveautomation.com/u/dan123)\
**Post date:** [July 24, 2020, 3:14pm UTC](https://forum.inductiveautomation.com/t/totalizer-for-a-historical-value/37014/2 "2020-07-24T15:14:49Z")

</div>

You can use an Hour Meter Transaction Group ([https://www.inductiveuniversity.com/videos/hour-and-event-meters/8.0](https://www.inductiveuniversity.com/videos/hour-and-event-meters/8.0)) to log the run time.

---

<div class="post-metadata">

**Author:** ![scott.stamps](https://avatars.discourse-cdn.com/v4/letter/s/ba9def/32.png) [@scott.stamps](https://forum.inductiveautomation.com/u/scott.stamps)\
**Post date:** [July 24, 2020, 9:03pm UTC](https://forum.inductiveautomation.com/t/totalizer-for-a-historical-value/37014/3 "2020-07-24T21:03:53Z")

</div>

Good stuff! I was able to set up the transaction group with an hour meter, which is logging to the database as expected. To expose the “total run time”, I have a separate query tag (outside of the transaction group), running at set intervals, which takes the value of the most recent record from the table. Any recommendations on a better way to do this? I was hoping I could set this separate tag within the transaction group, but did not immediately see how. Thanks!
