Show where value is under x for 7 days

Hi everyone :slight_smile:

I have a question regarding the visualization syntax for my time-series-panel.

  • First of all i am running a grafana cloud instance (version 8.5.2.) on my linux machine.
  • I want to have the data where my value is under x mA for example. But i only want to visualize those which are under this range for a specific amount of time (f.ex. 7day). So if i have a sensor that is under that x mA but only for a few minutes then i dont want to show it in my graph. But if this value is kept for lets say 24 hours or 2 days it should be shown.

Right now my syntax looks like this (flux):


from(bucket: v.bucket)
  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: (r) => r["_value"] <= 50)

but with that i query all points where values is under 50 mA.

Thank you in advance :slight_smile: Greetings Grafu

Group by 7d and mean() <= 50

maybe something like

  |> window(every: 7d)
  |> mean()
  |> group(columns: [“_time”, “_start”, “_stop, “_value”], mode: “except”)

play around with it in influxdb 8086 first and not in grafana