Home Search

DriveWorks Pro 22
SppTableGroupByColumns

Send Feedback

SppTableGroupByColumns

Returns a table showing distinct groups of values found in one or more columns.

Syntax

SppTableGroupByColumns([Table Array],[Group By Columns])

Where:

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

Group By Columns is the indexes of the columns to group by as a pipebar (|) delimited string, for example 2|7|5. Number starting at 1 for the first column.

Example

RuleResultMeaning
SppTableGroupByColumns(DwLookupPartDetails,"3|4"){"Quantity","Primary Color"; "3","Red"; "2","Yellow"; "1","Black"; "1","Blue"; "2","Blue"}Will return an Array showing distinct values from the third and fourth columns.

See Example Result Viewed as a Table below to see how the result of this example looks when viewed as a table.

Example Data

The data below exists as a Table in DriveWorks named PartDetails (DwLookupPartDetails)

PartPriceQuantityPrimary ColorSecondary Color
Casing2103RedRed
Side Panel85.42YellowBlue
Railing4991BlackOrange
Frame387.91BlueTeal
Support152.52BlueBlue
Chassis1275.751BlackBlack

Example Result Viewed as a Table

The array returned by the rule SppTableGroupByColumns(DwLookupPartDetails,"3|4") will look like:

QuantityPrimary Color
3Red
2Yellow
1Black
1Blue
2Blue