# Historian help needed

**URL:** <https://forum.inductiveautomation.com/t/historian-help-needed/51281>\
**Category:** Ignition\
**Created:** [September 23, 2021, 7:16pm UTC](https://forum.inductiveautomation.com/t/historian-help-needed/51281 "2021-09-23T19:16:24Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [September 23, 2021, 7:47pm UTC](https://forum.inductiveautomation.com/t/historian-help-needed/51281/4 "2021-09-23T19:47:35Z")

</div>

I disagree, I think tag history is great to use for what you need.

For your event, if you trust that you won't have multiple 1s or 0s in a row, then use count aggregate for one hour interval. If you could have multiples, then you will want to use a script. Something like the one below that @JordanCClark did, but instead of total time, you would change to total count.

> [@Calculating Total Time in Seconds](https://forum.inductiveautomation.com/t/calculating-total-time-in-seconds/49322/3):
>
> This may help you out: # Create sample dataset sampleHeaders = ['t\_stamp', 'value'] sampleData = [['2021-07-01 13:42:28', 1], ['2021-07-01 13:43:23', 1], ['2021-07-01 13:43:28', 0], ['2021-07-01 13:43:29', 0], ['2021-07-01 13:43:30', 1], ['2021-07-01 13:43:32', 1], ['2021-07-01 13:43:36', 0], ['2021-07-01 13:43:39', 1], ['2021-07-01 13:43:41', 1], ['2021-07-01 13:43:45'…

---

_[View the full topic](https://forum.inductiveautomation.com/t/historian-help-needed/51281)._
