[proFit-list] running sum?

Davide Guarisco guarisco at sbcglobal.net
Thu Oct 13 22:27:48 CDT 2011


On Oct 13, 2011, at 7:48 AM, Dave Sopchak wrote:

> Hi Davide,
> 	Thanks, but what I'm trying to do is build a column alongside another one that has the running sum of the first column:
> 
> 1	1
> 2	3
> 3	6
> 4	10
> 
> etc…



Ah, OK. If you want it permanently in another column, you can use the Integrate transformation. Just setup the second column as the integral of the first column over Row index and check the "Make it permanent". This works provided that you pad your data with a zero at both the beginning and the end. That's because it uses the trapezoidal formula, which, for the case of equidistant x values with step 1 (the "Row index") can be written as:

Integral = y0/2 + Sum(yi) + yn/2, (the online help has a mistake in the formula....)

where the summation is over the n-1 values yi (i=1... n-1), and y0 and yn are the first and last values of the sequence. If you make y0 and yn equal to zero, then you get the sum of your values!

However, this works only if you setup two columns like this, say columns 2 and 3. Column 3 updates correctly, while column 2 doesn't. I think this is a pro Fit bug....

Davide


More information about the proFit-list mailing list