How to divide the values of two singlestats?

Hi all,

I have a dashboard showing some singlestat values, in this case it displays the number of “Product searches” executed and the number of “Product bookings”.

These are calculated by doing an ElasticSearch query, for example the number of bookings is calculated like this:

What I would like to do is display a “Search to book ratio”, so simply the number of searches divided by the number of bookings. I’d like to display this on a third singlestat panel.

Is there a way to do this in Grafana?
If it’s not possible when using ElasticSearch queries, would it be possible with Prometheus, or any of the other data source options?


1 Like

Have you found any solution? I have the same question.

Hey @bmrec,

No, unfortunately I didn’t find any solution to this issue, at least not when using ElasticSearch.

On the other hand, this is easy to do with a custom query if the data source is a Prometheus metric.