# Range aggregation Mode return wrong result

**URL:** <https://forum.inductiveautomation.com/t/range-aggregation-mode-return-wrong-result/27334>\
**Category:** Ignition\
**Created:** [August 10, 2019, 1:50pm UTC](https://forum.inductiveautomation.com/t/range-aggregation-mode-return-wrong-result/27334 "2019-08-10T13:50:22Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![j.israelsen](https://avatars.discourse-cdn.com/v4/letter/j/ad7895/32.png) [@j.israelsen](https://forum.inductiveautomation.com/u/j.israelsen)\
**Post date:** [April 18, 2023, 5:09pm UTC](https://forum.inductiveautomation.com/t/range-aggregation-mode-return-wrong-result/27334/5 "2023-04-18T17:09:38Z")

</div>

Interesting, I had issues with the history aggregation but for different reasons.

Looks like @nader.chinichian mentioned that the aggregation worked if it was for just a single time period. Would looping through and calculating the range (one period at a time) help? If so, perhaps the code mentioned here could be applied to this scenario:

> [@Report - Tag Historian Query Aggregation by Day](https://forum.inductiveautomation.com/t/report-tag-historian-query-aggregation-by-day/69948):
>
> When I'm doing a Tag History Query on a Report I'm having issues dealing with daylight savings as I'm trying to do aggregation over the course of a day (but aggregation intervals can only be configured by hour). Is there anyway to get an aggregation mode by day (instead of hour)? I would hope aggregation by day would then handle the 23 hour day in March and the 25 hour day in November. Or are there other work arounds people have? I would think a lot of people would ha…

Note, this code was used to help resolve issues with daylight savings calculations and did so by looping through day by day (instead of using the history aggregation functions).

---

_[View the full topic](https://forum.inductiveautomation.com/t/range-aggregation-mode-return-wrong-result/27334)._
