Home Search

DriveWorks Pro 22
SppTableJoinColumns

Send Feedback

SppTableJoinColumns

Returns the incoming table with an additional column showing values in two or more columns joined together with a specified delimiter character.

Syntax

SppTableJoinColumns([Table Array],[Columns to Join],[Delimiter])

Where:

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

Columns to Join are the indexes of the columns to join as a pipebar (|) delimited string, for example 2|7|5. Number starting at 1 for the first column.

Delimiter is the delimiter to use when joining column values

Example

RuleResultMeaning
SppTableJoinColumns(DwLookupPartDetails,"4|5","-"){"Part" ,"Price" ,"Quantity" ,"Primary Color" ,"Secondary Color" ,"Primary Color-Secondary Color" ;"Casing" ,"210" ,"3" ,"Red" ,"Red" ,"Red-Red" ;"Side Panel" ,"85.4" ,"2" ,"Yellow" ,"Blue" ,"Yellow-Blue" ;"Railing" ,"499" ,"1" ,"Black" ,"Orange" ,"Black-Orange" ;"Frame" ,"387.9" ,"1" ,"Blue" ,"Teal" ,"Blue-Teal" ;"Support" ,"152.5" ,"2" ,"Blue" ,"Blue" ,"Blue-Blue" ;"Chassis" ,"1275.75" ,"1" ,"Black" ,"Black" ,"Black-Black"}Will return an Array combining columns 4 and 5 into a new column using - to separate values.

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 SppTableJoinColumns(DwLookupPartDetails,"4|5","-") will look like:

PartPriceQuantityPrimary ColorSecondary ColorPrimary Color-Secondary Color
Casing2103RedRedRed-Red
Side Panel85.42YellowBlueYellow-Blue
Railing4991BlackOrangeBlack-Orange
Frame387.91BlueTealBlue-Teal
Support152.52BlueBlueBlue-Blue
Chassis1275.751BlackBlackBlack-Black