Home Search

DriveWorks Pro 22
TableDistinctSum

Send Feedback

TableDistinctSum

Creates a table showing distinct values in the first column, and summed data in the second.

Syntax

TableDistinctSum([Table],[Column Index],[Column To Sum])

Where:

Table is the Table from which to get the result.

Column Index is the index of the column to group.

Column To Sum is the column index in the Table Array that will be summed for each unique value in the group column.

Example

RuleResultMeaning
TableDistinctSum(DwLookupStationaryOrder,1,3){"Items","Sum(Quantity)";"2B Pencil",2;"Black Biro",2;"Rubber",1;"HB Pencil",5}Will return an Array showing distinct values from the first column and summed data from the third column.

Example Data

Example StationaryOrder table (used in the example above).

ItemPriceQuantity
HB Pencil0.603
2B Pencil0.602
Black Biro0.801
Rubber1.501
HB Pencil0.602
Black Biro0.801

Result Viewed as a Table

The result given in the example, when viewed as a table, will look like:

ItemSum(Quantity)
HB Pencil5
2B Pencil2
Black Biro2
Rubber1