Display nothing when no Data is in Postgresql

Hi,

since i switched form InfluxDB to PostgreSQL i have Data Fields filled with Values that dont exists.

e.g.:

Here in PostgreSQL over the Night there are no values because WIFI/WLAN is turned off but PostgreSQL filles this fields with the latest existing value.

Please prove that statement with raw data (e.g. query inspector). I bet there are no data from PostgreSQL - they are just connected existing datapoints:

BTW you have heavy query, customize this for you needs:

SELECT
  $__timeGroupAlias(timecolumn, $agg, 0),
  AVG(value) AS "metric"
FROM table
WHERE
  $__timeFilter(timecolumn)
GROUP BY 1
ORDER BY 1

Read the doc to understand the used macros:

1 Like

Yeah this works:

SELECT $__timeGroupAlias(time, 1m, 0), AVG(value) AS solarertrag FROM solar WHERE $__timeFilter(time) AND field = 'watt' GROUP BY 1, value ORDER BY 1, value

But also works this: