Add daily max values to a monthly total


I have a customimized weather station and would like to display the monthly rainfall as a bar graph.

The rain detector writes the amount of rain measured each time it rains into the influxdb database and the value is added up daily in the database. I would like to add up the daily max values per month with Grafana and display them as a bar chart, the display is to be shown for 12 months.

I cannot work with “sum”, but can only add up the daily max values per month.

I have searched a lot, but have not found a solution yet.

I would be very grateful for possible solutions, unfortunately I don’t have much experience in Grafana yet.


I think your question if more flux than grafana?

import "date"

data = from(bucket: "weather")
  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: (r) => r["_measurement"] == "weather")
  |> filter(fn: (r) => r["_field"] == "accumulation")
  |> filter(fn: (r) => r["type"] == "rainfall")  

 |> truncateTimeColumn(unit: 24h)
 |> group(columns: ["_time"])
 |> max()
1 Like