Set start time every 30d from range start

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:00)
|> filter(fn: (r) => r._measurement == “TotalPower” and r._field == “value”)
|> aggregateWindow(
every: 30d, fn: (tables=<-, column) => tables
|> integral(unit: 1h)
|> map(fn: (r) => ({ r with _value: r._value / 1000.0})))

Hi @badincite

I have some hourly rainfall data going back 6 months. I ran two different aggregateWindow() functions and get the following two different views (both shown in Grafana). Does either help?

every: 30d

every: 1mo

What happens is when you select a specific date i.e.1/20 it doesn’t start from 1/20 and totalize 30days from that.

Try selecting a specific start date on yours you will see if doesn’t calculate correctly.

I have futzed around with various settings and cannot get it to group the data in 30 day increments starting from a specific date. Maybe someone from InfluxDB can chime in…

Messing around with this right now option to window based on start date · Issue #4993 · influxdata/flux · GitHub