Zoomed Image

AMSX Scripting Language - Command : consolidatetable

Summary

Consolidate a table by grouping rows on key fields with an aggregate function

Description

Groups the rows of the source table by the specified key fields and applies an aggregate function (MAX, MIN, AVG, SUM, or COUNT) to the remaining columns, writing the result to a new table. Useful for summarising imported data before further processing.

Parameters

ParameterDescription
cmdSource table name
Argument 0Destination table name for the consolidated result
Argument 1Comma-separated list of key fields to group by
Argument 2Aggregate function to apply to non-key columns: MAX, MIN, AVG, SUM, or COUNT

Syntax


ConsolidateTable "Source table name", "Destination table name for the consolidated result", "Comma-separated list of key fields to group by", "Aggregate function to apply to non-key columns: MAX, MIN, AVG, SUM, or COUNT"

Return to the AMSX Command Reference