Displaying Top 10 Series Based on Largest Change

Hi, new user here to Grafana and InfluxDB. I would like to create a time series graph, from InfluxDB, that displays only 10 items that have the largest change of values since day one of the time interval until the final day of the time interval chosen.

I believe I can write two InfluxDB queries that look like the following:

  1. SELECT last(“value”) from values where time >= now() group by “name”
  2. SELECT first(“vaue”) from values where time >= now() - 30d group by “name”

Now how do I go about subtracting the two values, taking the items with the top 10 differences, and feeding it back to Grafana to display a time series of values from day 1 to now() (or some date of choice) for those 10 items? Is this possible? What’s the best way to do this?


Grafana don’t support arithmetic function of the result from two influxdb queries. Either you have to solve this using one influxdb query. Else try the Meta Queries Plugin (disclaimer: I haven’t used or tested this plugin).