# Displaying states based on tag history

**URL:** <https://forum.inductiveautomation.com/t/displaying-states-based-on-tag-history/102602>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [February 19, 2025, 11:26pm UTC](https://forum.inductiveautomation.com/t/displaying-states-based-on-tag-history/102602 "2025-02-19T23:26:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jacob.brenkendorff](https://avatars.discourse-cdn.com/v4/letter/j/3bc359/32.png) [@jacob.brenkendorff](https://forum.inductiveautomation.com/u/jacob.brenkendorff)\
**Post date:** [February 19, 2025, 11:26pm UTC](https://forum.inductiveautomation.com/t/displaying-states-based-on-tag-history/102602/1 "2025-02-19T23:26:38Z")

</div>

I have a tag called MachineStatus with history set up on it. It is a short, and has 32 different machine status' 1-32. I would like to display information on the different states of this tag. How long the tag was in each state, and a count of how many times the tag entered each state. I am charting the tags state, but I want data I can feed back to management about times and occurrances of stops, faults, etc. Can you offer guidance? Thank you.

---

<div class="post-metadata">

**Author:** ![David\_Stone](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/david_stone/32/79749_2.png) [@David\_Stone](https://forum.inductiveautomation.com/u/David_Stone)\
**Post date:** [February 19, 2025, 11:45pm UTC](https://forum.inductiveautomation.com/t/displaying-states-based-on-tag-history/102602/2 "2025-02-19T23:45:14Z")

</div>

> **[system.tag.queryTagCalculations | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/7.9/appendix/scripting-functions/system-tag/system-tag-queryTagCalculations)**
>
> Queries various calculations (aggregations) for a set of tags over a specified range.

Have a look into tag history calculations and the way they can aggregate data over specific periods of time.
