# \[BUG\] queryAggregatedPoints returning incorrect aggregates when no data between start/end

**URL:** <https://forum.inductiveautomation.com/t/bug-queryaggregatedpoints-returning-incorrect-aggregates-when-no-data-between-start-end/116210>\
**Category:** Ignition\
**Created:** [June 30, 2026, 3:49pm UTC](https://forum.inductiveautomation.com/t/bug-queryaggregatedpoints-returning-incorrect-aggregates-when-no-data-between-start-end/116210 "2026-06-30T15:49:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![eaolson](https://avatars.discourse-cdn.com/v4/letter/e/f07891/32.png) [@eaolson](https://forum.inductiveautomation.com/u/eaolson)\
**Post date:** [June 30, 2026, 3:49pm UTC](https://forum.inductiveautomation.com/t/bug-queryaggregatedpoints-returning-incorrect-aggregates-when-no-data-between-start-end/116210/1 "2026-06-30T15:49:34Z")

</div>

I'm using queryAggregatedPoints and had the misfortune of specifying start/end time in between actual data points. The aggregate values coming back are unexpected. Here is the raw data:

> `"t_stamp","mypath"`  
> `"2026-06-09 22:33:11.861","8.100"`  
> `"2026-06-12 11:25:52.766","8.590"`  
> `"2026-06-18 09:51:12.169","8.319"`

Floats shortened for readability. Here is my query:

```python
data = system.historian.queryAggregatedPoints([tagPath, tagPath, tagPath, tagPath, tagPath, tagPath], 
    batch_start, batch_end, 
    aggregates=["Count", "LastValue", "Minimum", "Maximum", "Average", "SimpleAverage"],
    columnNames=["Count", "LastValue", "Minimum", "Maximum", "Average", "SimpleAverage"])
print batch_start
print batch_end
print system.dataset.toCSV(data)

Fri Jun 12 11:26:00 CDT 2026
Tue Jun 16 18:21:00 CDT 2026
"t_stamp","simpleaverage","simpleaverage","simpleaverage","simpleaverage","simpleaverage","simpleaverage"
"2026-06-12 11:26:00.000","0.0","8.394","8.394","8.394","8.492","8.394"

```

You'll notice that the start time is just after raw point #2 and the end time is before raw point #3. The Count is 0, as expected. But the columns for LastValue, Minimum, and Maximum are returning the same value as SimpleAverage. These are user-entered values and I need the value as entered by the user, not an interpolated value.

The column names are also messed up, but I think that's a known bug.

If I pull the start time back so that raw point #2 is included in the start/end times, the results are as expected:

```python
data = system.historian.queryAggregatedPoints([tagPath, tagPath, tagPath, tagPath, tagPath, tagPath], 
    system.date.addMinutes(batch_start, -60), batch_end, 
    aggregates=["Count", "LastValue", "Minimum", "Maximum", "Average", "SimpleAverage"],
    columnNames=["Count", "LastValue", "Minimum", "Maximum", "Average", "SimpleAverage"])
print system.dataset.toCSV(data)

"t_stamp","simpleaverage","simpleaverage","simpleaverage","simpleaverage","simpleaverage","simpleaverage"
"2026-06-12 10:26:00.000","1.0","8.590","8.590","8.590","8.493","8.590"

```

This is on 8.3.7
