grafana-flowcharting icon indicating copy to clipboard operation
grafana-flowcharting copied to clipboard

Replace null or no value of a query result(metric) with a specific value

Open github-ps1304 opened this issue 3 years ago • 0 comments

Hi I am using your panel extensively and love it !! THANKS.

Question: is there any way to "overwrite" a query result that has no value or null with a defined value?

Example: I am calculating the self consumption of my solar module, for a period of time the query returns no value or null. Is it possible to replace it with 100%.

My query: SELECT 100 - (last(einspeisung) / last(pv1))*100 from (SELECT sum("PVGesamt") / 60000 AS "pv1" FROM AC WHERE time>= $Heute), (SELECT sum("Bezug")/ -60000 AS "einspeisung" FROM AC WHERE "Bezug" <=0 AND time>= $Heute) fill(null)

regards Peter

github-ps1304 avatar Dec 05 '22 12:12 github-ps1304