Get each max or min from cycles

Ah sorry, @julien2 completely understand now! You can do this by grouping on ComprON

import "csv"

csvData =
    "
_time,TempComp,ComprON
2022-05-30T13:06:24Z,56.101875,1
2022-05-30T13:06:25Z,56.101875,1
2022-05-30T13:06:26Z,55.9775,1
2022-05-30T13:06:27Z,55.9775,1
2022-05-30T13:06:28Z,55.7909375,1
2022-05-30T13:06:29Z,55.6665625,1
2022-05-30T13:06:30Z,55.604375,1
2022-05-30T13:06:31Z,55.48,1
2022-05-30T13:06:32Z,55.355625,0
2022-05-30T13:06:33Z,55.355625,0
2022-05-30T13:06:34Z,55.355625,0
2022-05-30T13:06:35Z,55.48,0
2022-05-30T13:06:36Z,55.48,1
2022-05-30T13:06:37Z,55.5421875,1
2022-05-30T13:06:38Z,55.72875,1
2022-05-30T13:06:39Z,55.853125,1
2022-05-30T13:06:40Z,55.9153125,1
2022-05-30T13:06:41Z,55.9775,1
2022-05-30T13:06:42Z,56.0396875,0
2022-05-30T13:06:43Z,56.1640625,0
2022-05-30T13:06:44Z,56.2884375,0
2022-05-30T13:06:45Z,56.2884375,0
2022-05-30T13:06:46Z,56.2884375,1
2022-05-30T13:06:47Z,56.475,1
2022-05-30T13:06:48Z,56.5371875,1
2022-05-30T13:06:49Z,56.5371875,1
2022-05-30T13:06:50Z,56.599375,1
"

data = csv.from(csv: csvData, mode: "raw")
|> group(columns: ["ComprON"])
|> yield(name: "raw")|> map(fn: (r) => ({ r with _value: float(v: r.TempComp)}))

max = data 
  |> max()
  |> yield(name: "max")

min = data 
  |> min()
  |> yield(name: "min")