I am wondering how to create a column in a JMP table that is the running total of another column (which I may need to reference via the column name as a string). That is, if I have a column with the following data:
1
2
3
4
5
I would want to create a column with a formula whose contents would work out to
1
3
6
10
15
Currently I have this loop, working from a list of names of columns to take the running total of:
For(i = 2, i <= numCols, i++,
colName = colNames;
col = New Column("Cumulative " || colName,
Formula(Summation(j = 1, Row(), As Column(ColName)))
);
);
This appears to work, but is very slow and if I create multiple columns, they all end up with the same data somehow. What is the best way to do this?