# [rrd-users] Re: PREV-Function? SUM-CF ?

Alex van den Bogaerdt alex at ergens.op.het.net
Sun Sep 24 22:36:47 MEST 2006

```On Sun, Sep 24, 2006 at 06:14:18PM +0200, Rene Fritzsche wrote:

> PS: I think a SUM-ConsolidationFunction could be useful
> for problems like this..

Or do you perhaps mean: the total so far?

If so:

CDEF:watts=<whatever you need to get it right>
CDEF:total=PREV,UN,0,PREV,IF,watts,+

make sure that watts doesn't contain unknowns (change them into zero)

Reasoning:

First interval of "watts" is first amount of joules during 60 seconds
previous total is unknown, resulting "total" is set to zero plus watts

Second interval of "watts" is the next amount of joules during 60 seconds
Second interval of "total" is previous amount of total plus the current
amount of watts.

3rd interval: similar to 2nd.  And so on.

--
Alex van den Bogaerdt
http://www.vandenbogaerdt.nl/rrdtool/

--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://lists.ee.ethz.ch/rrd-users