我正在嘗試從現有表創建一個拆分錶,並將新列添加到拆分錶中,每個新列都具有基於拆分列的公式。 然而,代碼創建了新列,但給了我“公式評估錯誤”
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]) )
););