Using aggregate for data older than a month

Hi,

is there a way to aggregate data that is older than a month? In other words, data that is not older than a month can be read “singularly” while data older than a month will show the mean value.

Thanks!

Hello @sam5061,
If you don’t want to aggregate data that is younger than a month you can do the following:

from(bucket: "example-bucket")
  |> range(start: <start_time>, stop: -1m)
  |> filter(fn: (r) => r._measurement == "<your filters>")
  |> aggregateWindow(every: <whatever agg period>, fn: mean)  
  |> yield(name: "agg")

from(bucket: "example-bucket")
  |> range(start:  -1m, stop: now())
  |> filter(fn: (r) => r._measurement == "<your filters>")
  |> yield(name: " not agg")

Hi @Anaisdg

Did you mean 1m or 1mo?