i’m new on influxDB, i am work with influx + Grafana, and i would like to do math expression, not like below example but more complex, however even this one i can’t do it:
the result on below if the sum per query, not bwetween queries, i want the sum between t1 + t2
@cadavalsum() sums all the values in a specified column (default is _value) for each input table. To be able to add values returned from these queries, you need to pivot data so that each value you want to work with exists in a single row. For a pivot to work, you have to have a common value to pivot. Generally, this is _time, but in the case of your query, I don’t think your two streams of data will have common time stamps because one is summing all values in a column (with sum()), while the other is “downsampling” points into 1d averages. Since your query range is only one day, I assume you really only need the mean from the last day, not necessarily windowed aggregates like you’re currently using.
I’m making a lot of assumptions here, but I’m guessing you want t1 and t2 to each return a single scalar value and you want add those values to together. To return a scalar value from each stream, you need to use findColumn() which returns an array of values in a column. You can then reference a value in the array and return a scalar value.
So this is how I’d do what I think you’re trying to do: