All,
I beleive my question is very basic but I have yet to find an answer.
I have a data table as shown below
I wish to
a) include 3 new columns labelled %CFB column 3, %CFB column 4 and %CFB column 5. %CFB stand for % change from baseline.
b) Into each new column I wish to enter the % change from baseline with values derived from the following formula
%CFB = (x - Column 3)/Column 3, where "x" will be replaced with values from Column 3, 4 or 5 on each iteration coded below. Column 3 is the baseline value
dt = Current Data Table();
startcol = 3;
endcol = 5;
For( i = startcol, i <= endcol, i++,
data_col = Column( i ) << get name;
New column ("%CFB " || data_col) << Formula((( :data_col - :column 3) / :column 3) * 100 ));
Using the script above I have been able to create the new columns but no results from the formula are placed in them. When I manually swap column 3 for data_col in the formula all new columns are evaluated as zero as I would expect. This tells me the formula is at least correct and the data_col variable is not being interpreted/substituted as I would like. Any insight into getting this to work would be appreciated.
Thanks in advance for your assistance
Floyd Fox