Query Arithmetic Operators

Hi, I’d like to know if it is possible to apply an arithmetic operator on to the data retrieved from two different queries and display the output within grafana?

Best regards,



Yes, this is possible. Can you share your queries here and explain the artithmetic operator you want to apply (and which values you want to apply it to)?

Depending on how complex the math is, you can also use Grafana transformations on each query.

Hi @grant1,

Thank you for your response, at this point i’m only hoping to add the output of two queries to create a single visualisation such as:-

SELECT mean(“VALUE”) FROM “autogen”.“system_output” WHERE (“ASSET” =~ /^$panel1_meter$/) AND $timeFilter GROUP BY time($__interval), “ASSET” fill(null)


SELECT mean(“VALUE”) FROM “autogen”.“response_output” WHERE (“ASSET” =~ /^$panel1_meter$/) AND $timeFilter GROUP BY time($__interval), “ASSET” fill(null)

My long term goal is to acheive more but if I can get over this hurdle first it would be greatly appreciated

Time series, like this?

or this?

Or stat panel, like this?

or this?

I think the final visualisation would be the better solution

:+1: Good deal. I think using the Grafana transformation should be straightforward to configure. Post back if you get stuck.

Brilliant, that works perfectly thank you.

Do you happen to know how I could visualise the difference between one reading to the next in one of the queries above?

Great. Please mark the above as Solution so others can find it in the future.

Re: your other question, I do not know of a way to calculate the difference between subsequent values in Grafana, but it can be done in your InfluxQL query. See more here: InfluxQL functions | InfluxDB OSS 1.8 Documentation