# How to totalize

**URL:** <https://forum.inductiveautomation.com/t/how-to-totalize/8455>\
**Category:** Ignition\
**Created:** [May 15, 2014, 4:40pm UTC](https://forum.inductiveautomation.com/t/how-to-totalize/8455 "2014-05-15T16:40:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![amr123](https://avatars.discourse-cdn.com/v4/letter/a/e5b9ba/32.png) [@amr123](https://forum.inductiveautomation.com/u/amr123)\
**Post date:** [May 15, 2014, 4:40pm UTC](https://forum.inductiveautomation.com/t/how-to-totalize/8455/1 "2014-05-15T16:40:21Z")

</div>

I have an old SLC 5/02 and I know no way to totalize within the PLC programming because the analog value that I’m working with is in million gallons per day and I need daily totals in gallons.

Is there a way to totalize in the HMI??

---

<div class="post-metadata">

**Author:** ![drewdin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/drewdin/32/3363_2.png) [@drewdin](https://forum.inductiveautomation.com/u/drewdin)\
**Post date:** [May 15, 2014, 4:45pm UTC](https://forum.inductiveautomation.com/t/how-to-totalize/8455/2 "2014-05-15T16:45:48Z")

</div>

take x samples a day and add it to a tag for a daily total

---

<div class="post-metadata">

**Author:** ![amr123](https://avatars.discourse-cdn.com/v4/letter/a/e5b9ba/32.png) [@amr123](https://forum.inductiveautomation.com/u/amr123)\
**Post date:** [May 20, 2014, 11:23pm UTC](https://forum.inductiveautomation.com/t/how-to-totalize/8455/3 "2014-05-20T23:23:22Z")

</div>

So I need to setup a dataset and also need to divide the MGD sum by 1440 to get GPM?

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [May 21, 2014, 9:42am UTC](https://forum.inductiveautomation.com/t/how-to-totalize/8455/4 "2014-05-21T09:42:12Z")

</div>

Can you use a transaction group to log the values? One reading every minute (as you said, divided by 1440) logged to the database. You can then use a query to sum the daily, or populate a table or graph, or whatever you need to do with the data.

Depending on how often you log a value:

60 sec: sum of the values  
30 sec: sum of values divided by 2  
20 sec: sum of values divided by 3  
15 sec: sum of values divided by 4  
12 sec: sum of values divided by 5  
10 sec: sum of values divided by 6  
6 sec: sum of values divided by 10  
5 sec: sum of values divided by 12  
4 sec: sum of values divided by15  
3 sec: sum of values divided by 20  
2 sec: sum of values divided by 30  
1 sec: sum of values divided by 60

The more often you take a reading, the more accurate the total becomes, but there is more data being saved to the database. It’s up to you on where your tradeoff point is.
