DriveWorks Pro 16: SppSumTableColumnByGroup [send feedback...]

SppSumTableColumnByGroup

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

Syntax

SppSumTableColumnByGroup([Table Array],[Group By Column],[Column To Sum])

Where:

Table Array is a Table Array (such as the data in a standard table, or the result of a QueryDataValues function.

Group By Column is the column in the Table Array that will be grouped.

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

Example

RuleResultMeaning
SppSumTableColumnByGroup(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

This table shows an example order and where some items may of been added to an order more than once and there quantities need adding together.

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

Table of Contents