# Aggregation Mode Definitions

**URL:** <https://forum.inductiveautomation.com/t/aggregation-mode-definitions/5619>\
**Category:** Ignition\
**Created:** [December 27, 2012, 11:38am UTC](https://forum.inductiveautomation.com/t/aggregation-mode-definitions/5619 "2012-12-27T11:38:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gnguyen](https://avatars.discourse-cdn.com/v4/letter/g/41988e/32.png) [@gnguyen](https://forum.inductiveautomation.com/u/gnguyen)\
**Post date:** [December 27, 2012, 11:38am UTC](https://forum.inductiveautomation.com/t/aggregation-mode-definitions/5619/1 "2012-12-27T11:38:17Z")

</div>

Hi,

Since some version ago, some new aggregation modes appears, wich is good; but the documentation lacks their definition.  
Where can we get precise information on SQLTag History and following definition (formulas ?) : “Time-weighted Average”, “Min/max”, “Closet Value”, “Basic Average”

Thank you.

---

<div class="post-metadata">

**Author:** ![Colby.Clegg](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/colby.clegg/32/3282_2.png) [@Colby.Clegg](https://forum.inductiveautomation.com/u/Colby.Clegg)\
**Post date:** [December 27, 2012, 4:52pm UTC](https://forum.inductiveautomation.com/t/aggregation-mode-definitions/5619/2 "2012-12-27T16:52:00Z")

</div>

Hi,

They’re explained a bit in the section for the [queryTagHistory](http://inductiveautomation.com/support/usermanuals/ignition/system_tag_querytaghistory.htm) scripting function, but I’ll make a note to have the binding screen updated too.

Fundamentally, aggregation mode is how to deal with multiple values for a giving window of time. For example, what happens when there are 3 data points, but you only want to return 1 value:  
Time-weighted: Each value is weighted according to the amount of time it was valid for the window. So if a value is 0, and then spikes to 100 at the end of the window, the result will be more towards 0, not 50.

Min-Max: Two values are returned, the minimum value, and the maximum.

Closest Value: The value closest to the window boundary is returned. In other words, the last value of the window.

Basic Average: Normal average of the values, (V1+V2+Vn)/n.

Hope this helps,
