I am trying to take a table and apply a moving average to every function to every column. The script below is what I am trying, based on what I saw in another thread here. The goal is to make a new table and then apply the function while referencing the original. However, I keep getting a scoped data table access error.
Test = Open("C:\Users\abrokaw\Desktop\JMP MA Test Table.jmp"); //open value data table
Testcols = Test << Get Column Names( string ); //get column names
TestMA = New Table( "Test Table Smoothed" ); //make new table
TestMA << add rows(nrows(Test)); //make new table match rows with raw table
For( i = 1, i <= N Cols( Test ), i++,
Eval(
Parse(
"TestMA << New Column( \!"MA_" || Testcols[i] || "\!",
numeric,
continuous,
formula( test:" ||
Testcols[i] || "Col Moving Average( :Value, 1, 2, 2 ) ) )'"
)
)
);
TestMA << delete columns("column 1");