slightly different approach. (smaller example table, adjust as needed.)
dt=New Table( "Untitled 4",
Add Rows( 12 ),
New Column( "data",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [1, 2, 3, 10, 20, 30, 100, 200, 300, 1000, 2000, 3000] )
)
);
values=dt:data<<getvalues;// [1, 2, 3, 10, 20, 30, 100, 200, 300, 1000, 2000, 3000]
values=shape(values,nrows(values)/3)`;// transpose after reshape
values=vsum(values)`; // transpose after summing columns
newtable=astable(values);
The shape() function converts the 12x1 matrix to a 4x3, then transpose to 3x4. Vsum() does a vertical sum of the columns, leaving a 1x4, which is transposed back to a 4x1. Astable() makes a data table from that with 4 rows.
or...
Using Jim's approach, you could build the grouping column like this (using table above):
dt<<newcolumn("group",numeric,values(ceiling((1::12)/3)`));
Then grab the summary script from the source script in a manually created table.
Craige