Use the DIFFERENCE function in a continuous query and store the results in a new measurement. Then you can run SUM() against that measurement to get the sum of the differences.
Note that the DIFFERENCE function won't see the transition from 24 to 2 as equal to 2, but as equal to -22. You could use NON_NEGATIVE_DERIVATIVE for the function as well, I believe. That may give better results. On Fri, Aug 19, 2016 at 2:38 AM, <[email protected]> wrote: > I need something like this: > > counters if last month: 1 4 9 15 20 24 2 6 10 > differences: 3 5 6 5 4 2 4 4 > sum of diffs: 33 > > -- > Remember to include the InfluxDB version number with all issue reports > --- > You received this message because you are subscribed to the Google Groups > "InfluxDB" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/influxdb. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/influxdb/e223e248-ed65-48af-897c-f230ac472771%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- Sean Beckett Director of Support and Professional Services InfluxDB -- Remember to include the InfluxDB version number with all issue reports --- You received this message because you are subscribed to the Google Groups "InfluxDB" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/influxdb. To view this discussion on the web visit https://groups.google.com/d/msgid/influxdb/CALGqCvPiLC_q2pynnJVejT7t7p5%3DnjZY9g17iCpTkBVyriWJPw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
