How to divide values using Grafana?

Hello!

I’m curious about one thing, can I divide values using Grafana?

I found on InfluxDB developer site info about doing mathematical operations using InfluxDB, however, i’m also found some info that this is not possible. (https://docs.influxdata.com/influxdb/v1.3/query_language/math_operators/)

So, question is what is the true?

I have tried in so many ways configure that but nothing work. Is it possible? Can i divide 2 values using Grafana?

GRAFANA

Hi Tokash,

I use Grafana with InfluxDB. Here’s a partial screenshot of simple division performed on a Grafana metric.

grafana_math

HTH.

Regards,

Bill

you can use math expressions in InfluxDB select clause like select mean(“value”)*100

but that is about it. you cannot divide one query against the result of another. InfluxDB query language is very limited in its capability (compared to Graphite)

Hi Torkel!
Thanks for the answer. Maybe it’s not the answer that i would like to hear :slight_smile: but anyway, thank you so much! Now everything is clear.

If it’s FROM the same thing you can.

SELECT (last(A) / last(B)) * 100 FROM "C"

or

SELECT (count(A) / count(B)) FROM "C"

1 Like

That worked for me
Thanks!

what should I do if it’s 2 different FROMs like

SELECT last(A) FROM "B" + last(A) FROM "C"`

If not, is there a way to do that?