# Getting the bottom values of a range in tag history

**URL:** <https://forum.inductiveautomation.com/t/getting-the-bottom-values-of-a-range-in-tag-history/12115>\
**Category:** General Discussion\
**Created:** [September 10, 2016, 2:29am UTC](https://forum.inductiveautomation.com/t/getting-the-bottom-values-of-a-range-in-tag-history/12115 "2016-09-10T02:29:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SummonerSTX](https://avatars.discourse-cdn.com/v4/letter/s/ec9cab/32.png) [@SummonerSTX](https://forum.inductiveautomation.com/u/SummonerSTX)\
**Post date:** [September 10, 2016, 2:29am UTC](https://forum.inductiveautomation.com/t/getting-the-bottom-values-of-a-range-in-tag-history/12115/1 "2016-09-10T02:29:53Z")

</div>

Tried searching high and low for this but having trouble finding anything remotely close. I am doing water monitoring in a hotel and we would like to get the bottom values of a tag for a given history range. The idea is that all things being “normal” in our hotel the average of the bottom 10% of our flow values for a given day should be 0. In SQL there is a function that does just this but I cannot find anything that will let me do it using the historian. I guess I could build a transaction set to fill a database for this purpose but that seems like overkill.

Any advice would be much appreciated!
