Get timestamp info of max daily aggregate value


I’m using solar panel, I will need to identify for each day, when max production value is.

I would like also to get the timestamp and max value of daily aggregate

Basic query well provides the max value but I do not know when this max value was produced
For exemple : Today exemple 356 at 1:21pm

from(bucket: “Solar”)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r[“_measurement”] == “Total Power”)
|> aggregateWindow(every: 1d, fn: max, createEmpty: false)


Thanks in advance for your support

Hi @franckybel

You want to receive a table showing the timestamp and max value for each day, correct?

In this example, I have calculated the maximum daily energy demand for each region for the time window selected, and listed in a table the Date & Hour for each region when this max value occurred (as well as the actual peak demand). Maybe that will provide some guidance?

Also, if you need to know the timestamp where the max value is obtained, using this function may help. More here.

Hello @grant2

Perfect, thanks a lot, I have tried to find the solution without success.
You are strongly helping me.

I will use your inputs to build my report

Have a great day :wink: