<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />Hi,
I wrote a small script in which I create a table referenced by dtSum. This table has only one row. I want to add columns and populate them with the means of columns of another table which is referenced by dt. The question is how do I reference the columns of the other table, dt? The script right now looks like:
for(i = 2, i <= 9, i++,
dtSum << New Column( "att" || Char( i ),
Numeric,
Continuous,
<< Set Each Value( Col Mean( dt:Column( i - 1 ) ) )
)
);
This doesn't work. How do I reference column i - 1 in table dt and then find its mean? I wan to use Col Mean since I'll have to do this for other column stats. Any suggestions are appreciated.
Thanks,
Walt
Hello,
The Column function allows an optional data table argument. Instead of the dt:Column syntax, try this in your Col Mean function:
Column( dt, i-1 )
Hope that helps!