ValueTable.GroupBy

Syntax:

GroupBy(<GroupingColumns>, <TotalingColumns>)

Parameters:

<GroupingColumns> (required)

Type: String.
Column names, separated by commas, by which you want to group values table lines.

<TotalingColumns> (optional)

Type: String.
Column names, separated by commas, by which you want to sum values of values table rows.

Description:

Collapses the value table by specified group columns. Rows with matching values in columns specified by the first parameter are combined into one row. Values from these rows stored in the columns specified by the second parameter are accumulated.
Important: Column lists must not overlap. Columns that have not been included in any column lists are deleted from the value table after the method is executed.

Availability:

Server, thick client, external connection, Mobile application (server).

Note:

If there is a single type defined for the column, totaling would cause an attempt to cast values to the Number type.
If no types are assigned to the column, totaling will include only values of the Number type, ignoring values of other types.
If there are multiple types in the column including Number, then totaling will include only values of the Number type, ignoring values of other types.
If there are several types in the column, but they don't include the Number type, then the result is 0. It is assigned to a corresponding column, where it is made the default value set for the column.

Example:

PriceTable.GroupBy("Goods, Currency", "Price");

    

1C:Enterprise Developer's Community