I am new to grafana and writing queries and need some help. I would like to setup a graph that subtracts two values. I am not very familiar with query language so that is where I am struggling.
What I want to do is subtract
SELECT mean("value") FROM "Home" WHERE "topic" = '/house/power/solar' AND $timeFilter GROUP BY time(1m) fill(null)
from
SELECT mean("value") FROM "Home" WHERE "topic" = '/house/power/main' AND $timeFilter GROUP BY time(1m) fill(null)
Basically I am trying to get my actual power usage.
I am using influxdb v1.2 and my data is setup as shown below.
time host topic value 2017-05-17T01:31:49.303162625Z "AllingtonServ" "/house/power/main" 2323.419 2017-05-17T01:32:20.30254561Z "AllingtonServ" "/house/power/main" 2304 2017-05-17T01:32:51.308210601Z "AllingtonServ" "/house/power/main" 2322.935 2017-05-17T01:31:49.303162625Z "AllingtonServ" "/house/power/solar" -1250 2017-05-17T01:32:20.30254561Z "AllingtonServ" "/house/power/solar" -1240 2017-05-17T01:32:51.308210601Z "AllingtonServ" "/house/power/solar" -1238