Returns a two column table showing distinct values in the first column, and summed data in the second.
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.
Rule | Result | Meaning |
---|---|---|
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. |
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.
Item | Price | Quantity |
---|---|---|
HB Pencil | 0.60 | 3 |
2B Pencil | 0.60 | 2 |
Black Biro | 0.80 | 1 |
Rubber | 1.50 | 1 |
HB Pencil | 0.60 | 2 |
Black Biro | 0.80 | 1 |