Please,еell me how to calculate such data using flux. I need to take the sum of the maximums for 10 days from the data. I see it as two consecutive aggregate window functions, first with a search for the maximum with a window of 1 day, then the sum with a window of 10 days. The maximum is found correctly, but the sum for 10 days is not calculated.
water = from(bucket: "vending")
|> range(start: 2025-04-15T00:00:00Z, stop: 2025-04-24T00:00:00Z )
|> filter(fn: (r) => r["_field"] == "sdw")
|> filter(fn: (r) => r["name"] == "50_12_168" or r["name"] == "Ntz_9")
|> aggregateWindow(every: 1d, fn: max)
|> aggregateWindow(every: 10d, fn: sum)
|> drop(columns: ["uidi","_start","_stop"])