# \#aggregate

**URL:** https://community.influxdata.com/tag/aggregate/113.md

[Latest](https://community.influxdata.com/latest.md) · [Categories](https://community.influxdata.com/categories.md) · [Tags](https://community.influxdata.com/tags.md)

---

## [Aggregate the output from another aggregator?](https://community.influxdata.com/t/aggregate-the-output-from-another-aggregator/57652)

<div class="topic-metadata">

**Author:** [@Bill\_Chen](https://community.influxdata.com/u/Bill_Chen)\
**Replies:** 3\
**Last updated:** [July 24, 2025, 2:42pm UTC](https://community.influxdata.com/t/aggregate-the-output-from-another-aggregator/57652 "2025-07-24T14:42:55Z")

</div>

I don’t think this is explained in the docs (and got ChatGPT completely confused), but according to the source code I can’t currently use the output from one aggregator in another. I am wondering if there’s plan to allow…

---

## [How to aggregate by uneven daily hour intervals?](https://community.influxdata.com/t/how-to-aggregate-by-uneven-daily-hour-intervals/57586)

<div class="topic-metadata">

**Author:** [@dewi-ny-je](https://community.influxdata.com/u/dewi-ny-je)\
**Replies:** 0\
**Last updated:** [July 10, 2025, 7:33am UTC](https://community.influxdata.com/t/how-to-aggregate-by-uneven-daily-hour-intervals/57586 "2025-07-10T07:33:44Z")

</div>

I have a series with energy prices, and I can tell that I have two peaks and two dips in prices each day, and more specifically one pair in the hours 00:00-11:00 and one pair in the range 11:00-23:59. How can I calculat…

---

## [Telegraf Kafka Aggregation Issue: Not Processing Historical Data On Kafka Topic](https://community.influxdata.com/t/telegraf-kafka-aggregation-issue-not-processing-historical-data-on-kafka-topic/57397)

<div class="topic-metadata">

**Author:** [@akbasferhat](https://community.influxdata.com/u/akbasferhat)\
**Replies:** 2\
**Last updated:** [June 30, 2025, 9:11am UTC](https://community.influxdata.com/t/telegraf-kafka-aggregation-issue-not-processing-historical-data-on-kafka-topic/57397 "2025-06-30T09:11:53Z")

</div>

Telegraf’s basicstats aggregator fails to process one-month-old Kafka data despite: :white\_check\_mark: Setting offset = "oldest" :white\_check\_mark: Resetting consumer group offsets :white\_check\_mark: Kafka containing f…

---

## [Fill usePrevious with threshold](https://community.influxdata.com/t/fill-useprevious-with-threshold/56791)

<div class="topic-metadata">

**Author:** [@JeroenVH](https://community.influxdata.com/u/JeroenVH)\
**Replies:** 10\
**Last updated:** [March 26, 2025, 8:31am UTC](https://community.influxdata.com/t/fill-useprevious-with-threshold/56791 "2025-03-26T08:31:43Z")

</div>

To create a graph for event based data it is usefull to create empty entries with the aggregateWindow funtion and backfill them with the fill function. However, by doing this you lose the ability to “not connect null va…

---

## [aggregateWindow from specific starting point](https://community.influxdata.com/t/aggregatewindow-from-specific-starting-point/56480)

<div class="topic-metadata">

**Author:** [@t481](https://community.influxdata.com/u/t481)\
**Replies:** 1\
**Last updated:** [February 26, 2025, 7:35pm UTC](https://community.influxdata.com/t/aggregatewindow-from-specific-starting-point/56480 "2025-02-26T19:35:44Z")

</div>

Hello I’m trying to create a chart for a month to match my energy consumption for a billing window. My billing window starts on 25 of the month for 30 days. Is this possible using the aggregateWindow() function? If n…

---

## [Different result using Flux aggregateWindow() with timezone (standalone/cloud)](https://community.influxdata.com/t/different-result-using-flux-aggregatewindow-with-timezone-standalone-cloud/53242)

<div class="topic-metadata">

**Author:** [@leo-pusch](https://community.influxdata.com/u/leo-pusch)\
**Replies:** 3\
**Last updated:** [January 15, 2025, 11:00am UTC](https://community.influxdata.com/t/different-result-using-flux-aggregatewindow-with-timezone-standalone-cloud/53242 "2025-01-15T11:00:49Z")

</div>

I am using both InfluxDB v2.7.11 (windows) and InfluxDB Cloud 2 (on us-east-1-1.aws.cloud2.influxdata.com). Having same data in both of them. BUT querying data with aggregateWindow() and timezone gives me different res…

---

## [aggreateWindow window period and offset, how to RIGHT-ALIGN?](https://community.influxdata.com/t/aggreatewindow-window-period-and-offset-how-to-right-align/35400)

<div class="topic-metadata">

**Author:** [@evsc](https://community.influxdata.com/u/evsc)\
**Replies:** 2\
**Last updated:** [August 26, 2024, 1:58pm UTC](https://community.influxdata.com/t/aggreatewindow-window-period-and-offset-how-to-right-align/35400 "2024-08-26T13:58:44Z")

</div>

I am trying to understand the relationship between aggregateWindow’s window size and the offset parameter. My goal is to get the sum of a value over the dashboard’s time span, AND the sum of the previous timespan of the…

---

## [Automatic aggregate monthly](https://community.influxdata.com/t/automatic-aggregate-monthly/32415)

<div class="topic-metadata">

**Author:** [@hanhoe](https://community.influxdata.com/u/hanhoe)\
**Replies:** 8\
**Last updated:** [December 7, 2023, 3:53pm UTC](https://community.influxdata.com/t/automatic-aggregate-monthly/32415 "2023-12-07T15:53:48Z")

</div>

Hello! I write the data from my powermeter in the influxDB and display with Grafana. But the function “aggregateWindow(every: 1mo, fn: last, createEmpty: true)” takes a loooong time. Because there are many data. Is it…

---

## [Split cumulative data measurements in hourly / daily chunks](https://community.influxdata.com/t/split-cumulative-data-measurements-in-hourly-daily-chunks/28263)

<div class="topic-metadata">

**Author:** [@M\_W](https://community.influxdata.com/u/M_W)\
**Replies:** 3\
**Last updated:** [September 10, 2023, 5:17pm UTC](https://community.influxdata.com/t/split-cumulative-data-measurements-in-hourly-daily-chunks/28263 "2023-09-10T17:17:59Z")

</div>

Hi, sorry if this has been answered before, I tried to search, but I’m a newbie with InfluxDB2 and Flux. I receive cumulative kwH readings from my house energy meter which gets the total power consumption in kWh every …

---

## [Aggregate Window, Custom timeframe](https://community.influxdata.com/t/aggregate-window-custom-timeframe/30910)

<div class="topic-metadata">

**Author:** [@ajetsharwin](https://community.influxdata.com/u/ajetsharwin)\
**Replies:** 5\
**Last updated:** [August 5, 2023, 12:41pm UTC](https://community.influxdata.com/t/aggregate-window-custom-timeframe/30910 "2023-08-05T12:41:55Z")

</div>

Hi Team, I have a database which shows the quantity of items as of each minute. I want to refine my day to be from 1600 UTC yday to 1600 UTC today instead of 0000 yday to 0000 today. I then want to apply aggregate fun…

---

## [Sum multiple columns without specifying names](https://community.influxdata.com/t/sum-multiple-columns-without-specifying-names/30266)

<div class="topic-metadata">

**Author:** [@grindfiner](https://community.influxdata.com/u/grindfiner)\
**Replies:** 2\
**Last updated:** [June 14, 2023, 2:21pm UTC](https://community.influxdata.com/t/sum-multiple-columns-without-specifying-names/30266 "2023-06-14T14:21:30Z")

</div>

Hello, I am trying to query the daily network traffic for a single device. I managed to get a big table with the network traffic for each access point on each channel. It looks like this: The query for the output fr…

---

## [Beginner : How to aggregate the difference between min and max with Flux?](https://community.influxdata.com/t/beginner-how-to-aggregate-the-difference-between-min-and-max-with-flux/29681)

<div class="topic-metadata">

**Author:** [@usky73](https://community.influxdata.com/u/usky73)\
**Replies:** 1\
**Last updated:** [May 3, 2023, 3:30pm UTC](https://community.influxdata.com/t/beginner-how-to-aggregate-the-difference-between-min-and-max-with-flux/29681 "2023-05-03T15:30:34Z")

</div>

I receive the energy index every seconds and I want to store the energy usage every 1h I found the solution to do the calculation with join function. I tried to do a task based on this but ther is an error I cannot fin…

---

## [aggregateWindow function conditionaly based on first element only, possible?](https://community.influxdata.com/t/aggregatewindow-function-conditionaly-based-on-first-element-only-possible/29746)

<div class="topic-metadata">

**Author:** [@mrVanDalo](https://community.influxdata.com/u/mrVanDalo)\
**Replies:** 1\
**Last updated:** [May 2, 2023, 9:10am UTC](https://community.influxdata.com/t/aggregatewindow-function-conditionaly-based-on-first-element-only-possible/29746 "2023-05-02T09:10:17Z")

</div>

types.isNumeric is very slow. So filter metrics with that function before downsampling with an aggregateWindow function is not really an option. But because not every \_value is a number I have to use types.isNumeric if I…

---

## [Telegraf \[aggregators.starlark\] how to save old metric when using aggregators.starlark plugin](https://community.influxdata.com/t/telegraf-aggregators-starlark-how-to-save-old-metric-when-using-aggregators-starlark-plugin/29247)

<div class="topic-metadata">

**Author:** [@tantrinh0812](https://community.influxdata.com/u/tantrinh0812)\
**Replies:** 8\
**Last updated:** [April 18, 2023, 10:23am UTC](https://community.influxdata.com/t/telegraf-aggregators-starlark-how-to-save-old-metric-when-using-aggregators-starlark-plugin/29247 "2023-04-18T10:23:24Z")

</div>

Hi everyone! I want to use \[aggregators.starlark\] plugin from telegraf to calculate delta metric every 5 minutes - (current\_metric - last\_5m\_metric)/last\_5m\_metric. This is a block of starlark code: state = { "last"…

---

## [Confusing respone to aggregate-query (daily min, max, etc.)](https://community.influxdata.com/t/confusing-respone-to-aggregate-query-daily-min-max-etc/29437)

<div class="topic-metadata">

**Author:** [@Hesindian](https://community.influxdata.com/u/Hesindian)\
**Replies:** 2\
**Last updated:** [April 15, 2023, 8:54am UTC](https://community.influxdata.com/t/confusing-respone-to-aggregate-query-daily-min-max-etc/29437 "2023-04-15T08:54:44Z")

</div>

Hey there! :slight\_smile: I’m new to InfluxDB (Ver 2.7) and cannot find a solution for the following behaviour: I do collect temperature-measurements from a sensor (a few hundred readings per day) and want to calculate…

---

## [Set start time every 30d from range start](https://community.influxdata.com/t/set-start-time-every-30d-from-range-start/28762)

<div class="topic-metadata">

**Author:** [@badincite](https://community.influxdata.com/u/badincite)\
**Replies:** 4\
**Last updated:** [February 26, 2023, 4:38pm UTC](https://community.influxdata.com/t/set-start-time-every-30d-from-range-start/28762 "2023-02-26T16:38:49Z")

</div>

How can I set the aggregate window period to 30 days from the range start? Not sure what its doing exactly here 3 days then 30 days after that? from(bucket: “iotawatt/autogen”) |\> range(start : 2023-01-20T00:00:00-00:0…

---

## [Telegraf Source Code Questions Config AggProcessors](https://community.influxdata.com/t/telegraf-source-code-questions-config-aggprocessors/28353)

<div class="topic-metadata">

**Author:** [@MarkSCQ](https://community.influxdata.com/u/MarkSCQ)\
**Replies:** 3\
**Last updated:** [February 1, 2023, 6:35am UTC](https://community.influxdata.com/t/telegraf-source-code-questions-config-aggprocessors/28353 "2023-02-01T06:35:53Z")

</div>

I am recently reading Telegraf source code, from telegraf/agent.go at master · influxdata/telegraf · GitHub it mentioned AggProcessors. What is the meaning of AggProcessors and what is the difference between Processors …

---

## [\_time field sometimes off when using aggregateWindow()](https://community.influxdata.com/t/time-field-sometimes-off-when-using-aggregatewindow/28047)

<div class="topic-metadata">

**Author:** [@bado](https://community.influxdata.com/u/bado)\
**Replies:** 2\
**Last updated:** [January 13, 2023, 7:12am UTC](https://community.influxdata.com/t/time-field-sometimes-off-when-using-aggregatewindow/28047 "2023-01-13T07:12:54Z")

</div>

I get sensor data every 10 seconds. When using aggregateWindow as shown below, I would have expected the “\_time” field to stay the same over the 10 seconds period until the new data is available, however, if I submit the…

---

## [Averaging values over time period and then identifying the max value in each time period](https://community.influxdata.com/t/averaging-values-over-time-period-and-then-identifying-the-max-value-in-each-time-period/28126)

<div class="topic-metadata">

**Author:** [@somanyquestions](https://community.influxdata.com/u/somanyquestions)\
**Replies:** 0\
**Last updated:** [January 13, 2023, 4:05am UTC](https://community.influxdata.com/t/averaging-values-over-time-period-and-then-identifying-the-max-value-in-each-time-period/28126 "2023-01-13T04:05:48Z")

</div>

Hello, I have data points that are captured approximately every second from 5 different devices. I want to get the average value for each device every two seconds and then from this identify the device with the highest …

---

## [How to aggregate non-regular values using a time weighted average](https://community.influxdata.com/t/how-to-aggregate-non-regular-values-using-a-time-weighted-average/27619)

<div class="topic-metadata">

**Author:** [@dadivus](https://community.influxdata.com/u/dadivus)\
**Replies:** 2\
**Last updated:** [December 12, 2022, 7:46am UTC](https://community.influxdata.com/t/how-to-aggregate-non-regular-values-using-a-time-weighted-average/27619 "2022-12-12T07:46:46Z")

</div>

Hi, I hope you can help me with a behaviour that I do not fully understand. I have various sensors sending their values at non-regualar intervals; mostly they just send a value on changes. For some of those values, I …

---

## [Total Consumption summed up Last 7 days (not working)](https://community.influxdata.com/t/total-consumption-summed-up-last-7-days-not-working/27074)

<div class="topic-metadata">

**Author:** [@GoodOld](https://community.influxdata.com/u/GoodOld)\
**Replies:** 2\
**Last updated:** [October 23, 2022, 6:33pm UTC](https://community.influxdata.com/t/total-consumption-summed-up-last-7-days-not-working/27074 "2022-10-23T18:33:10Z")

</div>

Hello, I’m relatively new to Influx/Grafana and have been sitting for 2 days now with a problem that I just can’t get on with. It should be relatively simple, but somehow I do not get it. I have an electricity meter r…

---

## [Problematic default behaviour of window and aggregateWindow](https://community.influxdata.com/t/problematic-default-behaviour-of-window-and-aggregatewindow/27036)

<div class="topic-metadata">

**Author:** [@rruusu](https://community.influxdata.com/u/rruusu)\
**Replies:** 1\
**Last updated:** [October 20, 2022, 9:54am UTC](https://community.influxdata.com/t/problematic-default-behaviour-of-window-and-aggregatewindow/27036 "2022-10-20T09:54:04Z")

</div>

Hi, The documentation of window() and aggregateWindow() are not very clear on the topic, but by the examples, confirmed by trial, the selection of rows in each window uses a condition \_start \<= \_time \< \_stop. At the sa…

---

## [Grouping data by fields](https://community.influxdata.com/t/grouping-data-by-fields/26311)

<div class="topic-metadata">

**Author:** [@maholi](https://community.influxdata.com/u/maholi)\
**Replies:** 2\
**Last updated:** [August 29, 2022, 3:36pm UTC](https://community.influxdata.com/t/grouping-data-by-fields/26311 "2022-08-29T15:36:47Z")

</div>

Hi, I am have 2 different measurements with few columns that are same. This is default query for both measurements showing the same columns from(bucket: "bucket1") |\> range(start: v.timeRangeStart, stop: v.timeRangeS…

---

## [Aggregate measurement with tasks](https://community.influxdata.com/t/aggregate-measurement-with-tasks/26108)

<div class="topic-metadata">

**Author:** [@williamxo](https://community.influxdata.com/u/williamxo)\
**Replies:** 3\
**Last updated:** [August 15, 2022, 6:52pm UTC](https://community.influxdata.com/t/aggregate-measurement-with-tasks/26108 "2022-08-15T18:52:25Z")

</div>

Hey guys I am new to InfluxDB having trouble wrapping my head around writing the right query for my task. below is a sudo of what i am trying to achieve: Get points filtered by { task window (every 30m), measurement (“m…

---

## [Multiple Aggregation by Day (Max calculation) by Month (Sum Calculation)alue](https://community.influxdata.com/t/multiple-aggregation-by-day-max-calculation-by-month-sum-calculation-alue/25051)

<div class="topic-metadata">

**Author:** [@Franck\_Bellot](https://community.influxdata.com/u/Franck_Bellot)\
**Replies:** 9\
**Last updated:** [May 17, 2022, 6:37pm UTC](https://community.influxdata.com/t/multiple-aggregation-by-day-max-calculation-by-month-sum-calculation-alue/25051 "2022-05-17T18:37:29Z")

</div>

Hello, I’m beginner of Influx v2.2, I do not know how to run 2 aggregates to get the needed result. I need to know the electricity consumption by Month. To be able to generate this report I will need to do it in 2 ste…

---

## [Use Telegraf to only write reduce writes to Influx](https://community.influxdata.com/t/use-telegraf-to-only-write-reduce-writes-to-influx/24503)

<div class="topic-metadata">

**Author:** [@MarcoB](https://community.influxdata.com/u/MarcoB)\
**Replies:** 4\
**Last updated:** [April 26, 2022, 9:09pm UTC](https://community.influxdata.com/t/use-telegraf-to-only-write-reduce-writes-to-influx/24503 "2022-04-26T21:09:57Z")

</div>

I have measurements on a MQTT topic that are updated every 10 seconds. I use Telegraf to get this data and write it to my Influx2 db. That works fine, but generates a lot of overhead writes to Influx as I only need to s…

---

## [Aggregate by count?](https://community.influxdata.com/t/aggregate-by-count/24547)

<div class="topic-metadata">

**Author:** [@Nicolas\_Carrara](https://community.influxdata.com/u/Nicolas_Carrara)\
**Replies:** 7\
**Last updated:** [April 12, 2022, 9:04pm UTC](https://community.influxdata.com/t/aggregate-by-count/24547 "2022-04-12T21:04:11Z")

</div>

Hi, I do not find a way to aggregate data in chunks of equal sizes, you can only do it by time. Is there an easy way to do it, other than ready the whole time-serie in python and splitting it (taking forever !). For ex…

---

## [Two level aggregation](https://community.influxdata.com/t/two-level-aggregation/24275)

<div class="topic-metadata">

**Author:** [@raft](https://community.influxdata.com/u/raft)\
**Replies:** 0\
**Last updated:** [March 17, 2022, 4:27pm UTC](https://community.influxdata.com/t/two-level-aggregation/24275 "2022-03-17T16:27:43Z")

</div>

Hi, I was thinking below two queries will have identical results but this is not the case, they differ significantly. Can someone please explain why? from(bucket: "my-bucket") |\> range(start: v.timeRangeStart, stop: …

---

## [Couldn't reduce with pivot and group](https://community.influxdata.com/t/couldnt-reduce-with-pivot-and-group/23643)

<div class="topic-metadata">

**Author:** [@Duck](https://community.influxdata.com/u/Duck)\
**Replies:** 6\
**Last updated:** [February 2, 2022, 1:21pm UTC](https://community.influxdata.com/t/couldnt-reduce-with-pivot-and-group/23643 "2022-02-02T13:21:07Z")

</div>

Below code is perfectly working and separating users table with “pivot” and “group”. from(bucket:"statistics:daily") |\> range(start:-1d) |\> filter(fn: (r) =\> r\["\_measurement"\] == "players") |\> pivot(rowKey:\[…

---

## [Aggregates in InfluxDB](https://community.influxdata.com/t/aggregates-in-influxdb/21649)

<div class="topic-metadata">

**Author:** [@marcolettieri](https://community.influxdata.com/u/marcolettieri)\
**Replies:** 6\
**Last updated:** [September 14, 2021, 2:42pm UTC](https://community.influxdata.com/t/aggregates-in-influxdb/21649 "2021-09-14T14:42:54Z")

</div>

Hello, i’m new on influxDB. I want to store on InfluxDB raw given by a power absorption sensor and have the W/h graph. There is some function for InfluxDB to make aggregates per hour?

[Next page](https://community.influxdata.com/tag/aggregate/113.md?match_all_tags=true&page=1&tags%5B%5D=aggregate)
