how to apply the same formula to several columns in a table?<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />Hi,
I want to change the values contained in several columns of a database by applying a formula (see the attached example): values in "column a" must be modified according to the formula (a - m1) / m2. Same procedure for "column b" ((b - m1) / m2) and similarly for each column.
Thanks in advance for any advice
Re: how to apply the same formula to several columns in a table?Thanks MS, it works very well !
Re: how to apply the same formula to several columns in a table?If you want to change the values in-place, i.e. overwrite the old values, the easiest way is to run a script.
dt = Data Table("test-table");
cols = dt << get column names;
For(q = 3, q <= N Items(cols), q++,
For Each Row(cols[q][] = (cols[q][] - cols[1][]) / cols[2][])
);