# \[IGN-15587\]Possible bug with system.historian.queryAggregatedPoints() returnFormat="CALCULATION"

**URL:** <https://forum.inductiveautomation.com/t/ign-15587-possible-bug-with-system-historian-queryaggregatedpoints-returnformat-calculation/114195>\
**Category:** Ignition\
**Tags:** ignition83, scripting\
**Created:** [February 26, 2026, 3:33am UTC](https://forum.inductiveautomation.com/t/ign-15587-possible-bug-with-system-historian-queryaggregatedpoints-returnformat-calculation/114195 "2026-02-26T03:33:59Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![WillMT10](https://avatars.discourse-cdn.com/v4/letter/w/7feea3/32.png) [@WillMT10](https://forum.inductiveautomation.com/u/WillMT10)\
**Post date:** [February 26, 2026, 3:34am UTC](https://forum.inductiveautomation.com/t/ign-15587-possible-bug-with-system-historian-queryaggregatedpoints-returnformat-calculation/114195/1 "2026-02-26T03:34:00Z")

</div>

I’ve been playing around with the new `system.historian.queryAggregatedPoints()` function in 8.3.2 and I’m seeing some strange results when using `returnFormat="CALCULATION"`.

It almost seems like it is internally performing a cross-join of some sort with the calculated results to return far too many calculated columns - the number of calculated columns returned is equal to `len(paths)*len(aggregates)`. If I pass in 3 tags and 3 aggregates, I’m getting back a dataset with 9 calculated columns (plus the `t_stamp` and `tagpath` columns). The calculated column names and values are repeated every 3 columns.

I would assume this is a bug? Or am I missing a key piece of information for how to use this function with that specific parameter value?

> **Test Code**
>
> ```python
> tags = [
> "tagpath1", 
> "tagpath2", 
> "tagpath3",
> ]
> start = system.date.getDate(2026, 1, 25)
> end = system.date.addMinutes(start, 5)
> aggregates = ["Average", "Minimum", "Maximum"]
> ds = system.historian.queryAggregatedPoints(tags, start, end, aggregates, returnFormat="CALCULATION")
> 
> print "Column Names:", system.dataset.getColumnHeaders(ds)
> for r in ds:
> print r[0:2] + [round(c, 1) for c in r[2:]]
> 
> ```

> **Output**
>
> ```python
> Column Names: [u't_stamp', u'tagpath', u'Average', u'Minimum', u'Maximum', u'Average', u'Minimum', u'Maximum', u'Average', u'Minimum', u'Maximum']
> [Wed Feb 25 00:00:00 EST 2026, u'prov:Example:/tag:tagpath1', 1348.0, 1333.0, 1363.0, 1348.0, 1333.0, 1363.0, 1348.0, 1333.0, 1363.0]
> [Wed Feb 25 00:00:00 EST 2026, u'prov:Example:/tag:tagpath2', 70.0, 70.0, 70.0, 70.0, 70.0, 70.0, 70.0, 70.0, 70.0]
> [Wed Feb 25 00:00:00 EST 2026, u'prov:Example:/tag:tagpath3', 54.0, 54.0, 54.0, 54.0, 54.0, 54.0, 54.0, 54.0, 54.0]
> 
> ```

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 26, 2026, 1:41pm UTC](https://forum.inductiveautomation.com/t/ign-15587-possible-bug-with-system-historian-queryaggregatedpoints-returnformat-calculation/114195/2 "2026-02-26T13:41:19Z")

</div>

> [@WillMT10](#):
>
> If I pass in 3 tags and 3 aggregates, I’m getting back a dataset with 9 calculated columns (plus the `t_stamp` and `tagpath` columns).

That sounds right. It is inherently a "wide" format. (Not that that is best...)

---

<div class="post-metadata">

**Author:** ![WillMT10](https://avatars.discourse-cdn.com/v4/letter/w/7feea3/32.png) [@WillMT10](https://forum.inductiveautomation.com/u/WillMT10)\
**Post date:** [February 26, 2026, 4:36pm UTC](https://forum.inductiveautomation.com/t/ign-15587-possible-bug-with-system-historian-queryaggregatedpoints-returnformat-calculation/114195/3 "2026-02-26T16:36:08Z")

</div>

Wouldn't you expect one row per time window with a column for every path+aggregate pair in a wide format?

What I’m seeing is a strange hybrid. It gives me one row per path (Tall format), but then uses the column count of a Wide format. What's even more strange is it fills those extra columns with duplicate aggregate data from the _ **row's specific path** _.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 26, 2026, 4:52pm UTC](https://forum.inductiveautomation.com/t/ign-15587-possible-bug-with-system-historian-queryaggregatedpoints-returnformat-calculation/114195/4 "2026-02-26T16:52:32Z")

</div>

Ah, I misunderstood. Sounds like a bug worth reporting.

---

<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:** [February 26, 2026, 9:46pm UTC](https://forum.inductiveautomation.com/t/ign-15587-possible-bug-with-system-historian-queryaggregatedpoints-returnformat-calculation/114195/5 "2026-02-26T21:46:33Z")

</div>

A dev on the historian team did some investigation and filed a ticket for this. It's too early to give any kind of estimate on timeline, but we'll get it fixed.

---

<div class="post-metadata">

**Author:** ![WillMT10](https://avatars.discourse-cdn.com/v4/letter/w/7feea3/32.png) [@WillMT10](https://forum.inductiveautomation.com/u/WillMT10)\
**Post date:** [February 27, 2026, 1:34am UTC](https://forum.inductiveautomation.com/t/ign-15587-possible-bug-with-system-historian-queryaggregatedpoints-returnformat-calculation/114195/6 "2026-02-27T01:34:52Z")

</div>

Thanks Paul. Would it be possible to get an answer from the historian team on the intended output format - tall vs wide? Just making sure I avoid bad assumptions on my end.

---

<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:** [February 27, 2026, 4:46pm UTC](https://forum.inductiveautomation.com/t/ign-15587-possible-bug-with-system-historian-queryaggregatedpoints-returnformat-calculation/114195/7 "2026-02-27T16:46:10Z")

</div>

I think the expected format is 'wide' - one column in the output per provided input. Whatever you get if you don't use `CALCULATIONS`.
