Here is a general script that does what I described above. Applies to any table as column number and names need not to be specified.
dt = Current Data Table();
dt2 = Eval(
Parse(
Eval(
Expr(
"dt << Summary(group(" || Substitute(
Substitute( Char( dt << get column names() ), "}", "" ),
"{", ""
) || "))"
)
)
)
);
dt2 << delete column( Eval( N Col( dt ) + 1 ) );
The script populates Group(column1, column2,...) by deleting the curly brackets from a list of columns. Is anybody aware of a simpler, less convoluted way to use a list variable of columns as an argument in Summary() and similar functions?
If duplicates are defined by a subset of columns rather than all columns, one way would be to replace "get column names" with "get selected columns" in the above script. However, the columns must then first be manually selected in the data table, and the summary table updated with the original table to restore remaining columns.