Sum off all values from a variable

I have made a variable with multiple values.image

What i want to do is that i call all the values in the variable and make a sum out off all entrys.
My query looks like this:
SELECT sum(“value_float”) FROM “Measurement” WHERE (“generic_name” = ‘calculated/${var_name}/test1/test2’) AND $timeFilter GROUP BY time($__interval) fill(null)

Every variable value is returning a line like this:

Is there a way to achive this?
I’m using Grafana 7.5 and InfluxDB 2.0

Hi @patse

It sounds like you want to reduce a time series into a single value – in this case, the total amount, yes? The Time Series panel might not be ideal for that. Have you tried using the stat panel and then using the panel editor’s value options to return a calculated value like total?

Another hint would be to switch your current query to the table panel visualization to better understand how Grafana is formatting your data. Then explore transformations like reduce to manipulate the table the way you want. Then switch back to another visualization :+1:

This topic was automatically closed after 365 days. New replies are no longer allowed.