Find maximum of value averaged over time increments

Hi all,

New user here. I have data in Grafana logged at every 30 seconds. I am trying to take the average value for every 15 minute increment for a selected time period and then display the maximum value of those increments. So the result should be a single value. Currently I am trying

SELECT max(“field”) FROM “place” WHERE (“device” =~ /^$SystemSelect$/) AND $timeFilter GROUP BY time(15m), “device” fill(linear)

does group by time(15m) not accomplish taking the 15 minute average?

  • What Grafana version and what operating system are you using?
    v.7.3.7

  • What are you trying to achieve?
    above

  • How are you trying to achieve it?
    above

  • What happened?
    The resulting values were too high, likely not an average

  • What did you expect to happen?
    The value to reflect the maximum 15 minute average. For example the average power consumption from 2:30 to 2:45 was 500 kW and this was the maximum value of the selected time period that is the value that should be returned.

Hi @lmw have you explored using Grafana’s global variables to help manage your time selection?

This topic was automatically closed after 365 days. New replies are no longer allowed.