Minimum values within a window

Probably very basic flux question. I would like to take the minimum and maximum value for each of my fields within a window so that I can for example find the daily maximum of each. This is easy to do for mean the mean value:

from(bucket: "prod")|> range(start: -10d) 
                                        |> window(every: 1d)
                                        |>mean()
                                        |> group(columns: [ "device_id"]) 
                                        |> duplicate(column: "_start", as: "_time")

but I can’t seem to get theequivalent expression for the minimum. Any help would be greatly appreciated.

Hello @sgaw,
Welcome!
I’d do the following:

data = from(bucket: "prod")|> range(start: -10d) 
                                        |> window(every: 1d)
mean_data = data 
                                        |>mean()
                                        |> group(columns: [ "device_id"]) 
                                        |> duplicate(column: "_start", as: "_time")
                                        |> yield(name: "mean") 

min_data = data 
                                        |>min()
                                        |> group(columns: [ "device_id"]) 
                                        |> duplicate(column: "_start", as: "_time")
                                        |> yield(name: "mean") 

I hope that helps!
You might also look into using