0

My current query is

SELECT bin(time, 5m) AS bin, sum(measure_value::double) as bytesdropped FROM $__database.$__table 
where measure_name='messurename' and $__timeFilter
group by bin(time, 5m) order by bin

unfortunately, the bytesdropped value is cumulative, for example a table of the data:

bin bytesdropped cum
t0 0
t1 100
t2 100
t3 110
t4 110
t5 115
t6 115

when no bytes dropped, the the bytes dropped value does not report as zero, but instead reports as the previous value, IE t2 after t1 means no bytes dropped at t2 (100 bytes had dropped at t1)

how do I modify (or re-write completely) my query such that I only show the change between the current time and the last time. IE:

bin bytesdropped
t0 0
t1 100
t2 0
t3 10
t4 0
t5 15
t6 0
AC.
  • 1,005
  • 2
  • 12
  • 20

0 Answers0