# Average Historical Data on a tag

**URL:** <https://forum.inductiveautomation.com/t/average-historical-data-on-a-tag/16150>\
**Category:** General Discussion\
**Created:** [November 28, 2017, 5:59pm UTC](https://forum.inductiveautomation.com/t/average-historical-data-on-a-tag/16150 "2017-11-28T17:59:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![m.edmonson](https://avatars.discourse-cdn.com/v4/letter/m/8e7dd6/32.png) [@m.edmonson](https://forum.inductiveautomation.com/u/m.edmonson)\
**Post date:** [November 28, 2017, 5:59pm UTC](https://forum.inductiveautomation.com/t/average-historical-data-on-a-tag/16150/1 "2017-11-28T17:59:58Z")

</div>

Hello, Im having some trouble attempting to take the history of a tag and average it and i guess store it in another tag. I know theres more then one way to do it but i cant figure anything out. Thanks in advance

---

<div class="post-metadata">

**Author:** ![salbrechtsen](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/salbrechtsen/32/18660_2.png) [@salbrechtsen](https://forum.inductiveautomation.com/u/salbrechtsen)\
**Post date:** [November 28, 2017, 8:43pm UTC](https://forum.inductiveautomation.com/t/average-historical-data-on-a-tag/16150/2 "2017-11-28T20:43:35Z")

</div>

Depending on if you plan to use scripting or not, system.tag.queryTagHistory accepts an “aggregationMode” parameter. You can simply pass in your start and ent time and “Average” or “SimpleAverage” as the aggregationMode paramter.

Documentation can be found [here](https://docs.inductiveautomation.com/display/DOC79/system.tag.queryTagHistory)
