# MinMax not consistent with queryTagHistory

**URL:** <https://forum.inductiveautomation.com/t/minmax-not-consistent-with-querytaghistory/72984>\
**Category:** Ignition\
**Tags:** perspective, ignition81, scripting\
**Created:** [April 27, 2023, 6:35pm UTC](https://forum.inductiveautomation.com/t/minmax-not-consistent-with-querytaghistory/72984 "2023-04-27T18:35:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shawn\_Rieger](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/shawn_rieger/32/46336_2.png) [@Shawn\_Rieger](https://forum.inductiveautomation.com/u/Shawn_Rieger)\
**Post date:** [April 27, 2023, 6:35pm UTC](https://forum.inductiveautomation.com/t/minmax-not-consistent-with-querytaghistory/72984/1 "2023-04-27T18:35:32Z")

</div>

When I make a request using queryTagHistory and set aggregation mode to MinMax, the order or min and max are not consistent.

As you can see in the export below, in some timestamps the Max value is first, in others Min is first.

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/5/f519ae5c0bf38014d07f0a708e8ed01bd77d15ff.png)

---

<div class="post-metadata">

**Author:** ![code\_skin](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@code\_skin](https://forum.inductiveautomation.com/u/code_skin)\
**Post date:** [April 27, 2023, 7:03pm UTC](https://forum.inductiveautomation.com/t/minmax-not-consistent-with-querytaghistory/72984/2 "2023-04-27T19:03:03Z")

</div>

What happens when you use returnSize = 1?

---

<div class="post-metadata">

**Author:** ![Shawn\_Rieger](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/shawn_rieger/32/46336_2.png) [@Shawn\_Rieger](https://forum.inductiveautomation.com/u/Shawn_Rieger)\
**Post date:** [April 27, 2023, 8:17pm UTC](https://forum.inductiveautomation.com/t/minmax-not-consistent-with-querytaghistory/72984/3 "2023-04-27T20:17:13Z")

</div>

I only get one min max for the entire range instead of each interval.
