I am trying to create a split table from an existing table and add new columns into the split tables each with a formula based on the columns that were split. However the code creates the new columns but gives me "Formula evaluation errors"
dt2 = Current Data Table();
// Create the split data table
dt2 = dt << Split(
Split By( :S ),
Split(
:Name( "Median(data)" )
),
Group( :L, :m, :C, :P, :z, :x ),
Remaining Columns( Drop All ),
Sort by Column Property
);
colname = {"B","C"};
colby = {"A","B"};
// Add new columns to the split data table
For( i = 1, i <= N Items( colname ), i++,
dt2 << New Column( colname[i]||"/"||colby[i],
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula( column(colname[i]) / column(colby[i]) )
););