I'm sorry, but in my haste I didn't spot the fact that the rows are genuine duplicates (as you might have seen from my example). I also didn't appreciate that you want to sum over columns.
If you can rely on this strict duplication, then you could do:
NamesDefaultToHere(1);
// Make some test data: Note that pairs of rows are duplicates!
dt = New Table( "Test Data",
New Column( "Group", Numeric, "Nominal", Values([1,1,1,1,1,1,2,2,2,2,2,2])),
New Column( "Test 1", Numeric, "Ordinal", Values([2,2,3,3,4,4,5,5,6,6,7,7])),
New Column( "Test 2", Numeric, "Ordinal", Values([1,1,2,2,3,3,4,4,5,5,6,6]))
);
// List of columns for Summary
colList = {:Test 1, :Test 2};
// Summary
dt2 = dt << Summary(Group( :Group ), Sum( Eval(colList) ), StatisticsColumnNameFormat("column"));
// Sum over the columns in the summary, but also divide by 2 to account for the duplicate rows in dt
// (1) Template exprtession
CMD = Expr(dt2 << New Column( "Required Sum", Numeric, "Continuous", Formula( Sum(colsTBD) / 2 )));
// (2) Substitute in the columns we have
SubstituteInto(CMD, Expr(colsTBD), Eval(colList));
// (3) Use the expression we have built
CMD;