Filter field by name not working/selecting influxdb column

  • What Grafana version and what operating system are you using?
    Grafana v10.3.3 (252761264e) raspian buster.

  • What are you trying to achieve?
    Display in a Stat panel the mean value of 2/3 columns of an influxdb query calculated in another panel.

  • How are you trying to achieve it?
    I’ve applied a transformation to select the two columns that I am interested on, before calculating the mean using the “value options” → calculate → Mean function.

  • What happened?
    The panel displays the two mean values for a couple of seconds, but soon after one of the two values disappears. This happens always, i.e., it is reproducible.

  • What did you expect to happen?
    To keep the two target mean values.

  • Can you copy/paste the configuration(s) that you are having problems with?
    The problem might be related to the actual influxdb query, which although it does not outputs any error, I’m not overly confident with. The overall objective of this project is to calculate and display the daily average hours of sunlight on each side of my roof, these are the 2/3 columns, and the last column is a separate calculation of the amount of energy which would be generated by a PV array in one side of the roof minus average energy consumption (days_of_autonomy column below). The query is as follows

from(bucket: "DOMOTICZ")
  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: (r) => r._measurement == "Solar-Radiation")
  |> filter(fn: (r) => r["idx"] == "23")
  |> map(fn: (r) => ({r with _value: r._value / (9876.0*1000.0)}))
  |> window(every: 1d)
  |> integral(unit: 1h)
  |> map(fn: (r) => ({r with days_of_autonomy: r._value*10.0*0.435 - 4.70 }))
  |> duplicate(column: "_stop", as: "_time")
  |> window(every: inf)
  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
    No, that’s what’s most strange…the stat panel simply updates itself by deleting one of the two mean values (see attached images)
    Screenshot from 2024-02-27 18-07-00
    Screenshot from 2024-02-27 18-06-43

  • Did you follow any online instructions? If so, what is the URL?