79170583

Date: 2024-11-08 15:17:09
Score: 1
Natty:
Report link

The solution is to use a single query with GROUP BY and a Grafana transformation that transposes the table:

SELECT roomid AS "room id", SUM(mvalue) AS "energy consumption in the room" FROM periodic_measurements WHERE ($__timeFilter(mtimestamp) AND apartmentid = $apartment AND metric = 5) GROUP BY roomid;

enter image description here

Reasons:
  • Whitelisted phrase (-1): solution is
  • Probably link only (1):
  • Low length (0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Berni Hacker