How to divide queryA value by query B value and graph result

Hi all, I am pretty new to Grafana and am not sure if what I am trying to do is possible in Grafana or not, but here’s what I am struggling with:

I have two queries, from different data sources:

  1. selects amount of m3 of gas used in a day (for central heating)
  2. selects “weighted degree days”, a calculated number based on desired temperature in the house and average outside temperate over a day.

By dividing the value from query 1 (gas burned for heating) by query 2 (number of weighted degree days), you get the amount of gas burned per weighted degreeday.

I have no clue how to setup that division and graph it over an X day period. Is that at all possible?

That would allow me to compare energy usage across days, irrespective (sort of) of weather/temperature influences). This helps to see the impact of energy reduction steps such as adding isolation, etc.

Hope someone can point me in the right direction…

You can install this datasource: https://grafana.com/plugins/goshposh-metaqueries-datasource

It supports metric arithmetic between queries from different datasources.

1 Like

Awesome, thanks! I’ll give that a go :slight_smile:

Can you show the query that you used?