# HistoryQueryExecutor MinMax return format?

**URL:** <https://forum.inductiveautomation.com/t/historyqueryexecutor-minmax-return-format/66440>\
**Category:** Module Development\
**Created:** [November 13, 2022, 8:07pm UTC](https://forum.inductiveautomation.com/t/historyqueryexecutor-minmax-return-format/66440 "2022-11-13T20:07:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jpark](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@jpark](https://forum.inductiveautomation.com/u/jpark)\
**Post date:** [November 13, 2022, 8:07pm UTC](https://forum.inductiveautomation.com/t/historyqueryexecutor-minmax-return-format/66440/1 "2022-11-13T20:07:36Z")

</div>

I am unable to get a custom HistoryQueryExecutor to return multiple values with the same time stamp when MinMax is selected.

List of Qualified Values is [[10.0, Good, Sun Nov 13 11:15:46 PST 2022 (1668366946147)], [15.0, Good, Sun Nov 13 11:15:46 PST 2022 (1668366946147)], [20.0, Good, Sun Nov 13 11:16:46 PST 2022 (1668367006147)], [25.0, Good, Sun Nov 13 11:16:46 PST 2022 (1668367006147)]]

((ProcessedHistoryColumn) columnNodes.get(0)).put(the list from above)

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [November 15, 2022, 6:15pm UTC](https://forum.inductiveautomation.com/t/historyqueryexecutor-minmax-return-format/66440/2 "2022-11-15T18:15:12Z")

</div>

At the `com.inductiveautomation.gateway.tags.history.query.processing.aggregates.MinMaxAggregate#process` level, MIN and MAX are being cached into the block context using `min` and `max` as keys, and the overall result of `process` is a `QualifiedValue[]` with two values; the min and max.

It looks like the HistoryQueryExecutor should be calling into the column to process it in `processData`; the column then calls into the aggregation function:  
`((HistoryColumn) nodes.get(p.index()).getDelegate()).process(historicalValue(p));`

---

<div class="post-metadata">

**Author:** ![andrew.jank](https://avatars.discourse-cdn.com/v4/letter/a/e9a140/32.png) [@andrew.jank](https://forum.inductiveautomation.com/u/andrew.jank)\
**Post date:** [August 1, 2025, 6:51pm UTC](https://forum.inductiveautomation.com/t/historyqueryexecutor-minmax-return-format/66440/3 "2025-08-01T18:51:07Z")

</div>

Adding this here for visibility when someone has the same problem agian  
See implementation here:

> [@How to store MinMax aggregate values as QualifiedValues in ProcessedHistoryColumn?](https://forum.inductiveautomation.com/t/how-to-store-minmax-aggregate-values-as-qualifiedvalues-in-processedhistorycolumn/109099/2):
>
> I figured it out. I had to create my own History Node using decompiled versions of DefaultHistoryColumn and ProcessedHistoryColumn. ProcessedHistoryColumn does not work for MinMax and cannot be used. I created the following column to be used for MinMax and the standard case of 1 value per column. import com.inductiveautomation.ignition.common.TypeUtilities; import com.inductiveautomation.ignition.common.model.values.BasicQualifiedValue; import com.inductiveautomation.ignition.common.model.val…
