Sum up last values in the same time range

Hi,

I have a problem summarizing the last values from my series. The series gets updated at the same time (every minute), but not every series gets an update. So the following query mixes current and older values:

SELECT sum(“last”) FROM (SELECT last(“value”) FROM “dbi_value” WHERE $timeFilter GROUP BY time($__interval), “type_instance” fill(null)) WHERE $timeFilter GROUP BY time($__interval) fill(previous)

How can I only sum up values from the same time range (same minute)? The Series which have no value for a time range should be ignored.

Thanks in advance!
Dominik

Hello @dominikkv,
Thank you for your question. I’m not entirely sure what you’re asking but you can’t treat series with separate fill parameters. What version of InfluxDB are you using? I’m sure we can figure out a query in flux. Can you please provide some example input and output data? Thank you.

Hi Anais,

thank you for your reply. I’ll try to explain it with a simplified example.

We have a support ticket system where tickets get categorized by channel. A collectd deamon sums up the amount of tickets in each channel every minute and reports those values to InfluxDB 1.7.9. When a channel has 0 tickets, no value will be reported!

Now we want to add a graph for the total amount of tickets. This means we have to sum up the ticket count of all channels.

The problem is that when using the query from my first post, it sums up the last values in a time window. That is, when a channel has 0 tickets at time X, it will take the value from time X-1, because that is the last value for this series…

So the question is, how can I rewrite the query that only values with the same timestamp are summed up?

Thanks!
Dominik