Home Search

DriveWorks Pro 22
SppTableFilterByColumnComparison

Send Feedback

SppTableFilterByColumnComparison

Returns a table based on filtering by comparing values in two separate columns.

Syntax

SppTableFilterByColumnComparison([Table Array],[Column 1],[Column 2],[Include when matching])

Where:

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

Column 1 is the first column for comparison. Number starting at 1 for the first column.

Column 2 is the second column for comparison. Number starting at 1 for the first column.

Include when matching is TRUE to only return rows where the columns match, FALSE to only return rows where the columns do not match.

Examples

Example 1

The example below filters the data (given in Example Data below), to show Parts that only have a solid color (Primary Color and Secondary Color columns match).

RuleResultMeaning
SppTableFilterByColumnComparison (DwLookupPartDetails,4,5,TRUE){"Part","Price","Quantity","Primary Color","Secondary Color"; "Casing","210","3","Red","Red"; "Support","152.5","2","Blue","Blue"; "Chassis","1275.75","1","Black","Black"}Will return an Array showing values that match between the fourth and fifth columns.

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

Example 2

The example below filters the data (given in Example Data below), to show Parts that have two-tone colors (Primary Color and Secondary Color columns do not match).

RuleResultMeaning
SppTableFilterByColumnComparison (DwLookupPartDetails,4,5,FALSE){"Part","Price","Quantity","Primary Color","Secondary Color"; "Casing","210","3","Red","Red"; "Support","152.5","2","Blue","Blue"; "Chassis","1275.75","1","Black","Black"}Will return an Array showing values that do not match between the fourth and fifth columns.

See Example 2 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 1 Result Viewed as a Table

The array returned by the rule SppTableFilterByColumnComparison(DwLookupPartDetails,4,5,TRUE) will look like:

PartPriceQuantityPrimary ColorSecondary Color
Casing2103RedRed
Support152.52BlueBlue
Chassis1275.751BlackBlack

Example 2 Result Viewed as a Table

The array returned by the rule SppTableFilterByColumnComparison(DwLookupPartDetails,4,5,FALSE) will look like:

PartPriceQuantityPrimary ColorSecondary Color
Side Panel85.42YellowBlue
Railing4991BlackOrange
Frame387.91BlueTeal