0

I'm trying to get the kWh from multiple entities in InfluxDB in Grafana. I have the following raw query.

SELECT ("a" + "b")  / 3600000 FROM (
    SELECT spread("watt_seconds") AS "a" FROM "W"
    WHERE ("entity_id" = 'cabana') AND $timeFilter fill(null)
),(
    SELECT spread("watt_seconds") AS "b" FROM "W"
    WHERE ("entity_id" = 'pool_parcel') AND $timeFilter fill(null)
)

this always returns 0.

If I use ("a" + "a") I get 2*a, and if I use ("b" + "b") I get 2*b, as expected. But when I add the two subqueries, I always get 0.

What am I doing wrong.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.