Returns a table based on filtering by comparing values in two separate columns.
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.
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).
Rule | Result | Meaning |
---|---|---|
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.
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).
Rule | Result | Meaning |
---|---|---|
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.
The data below exists as a Table in DriveWorks named PartDetails (DwLookupPartDetails)
Part | Price | Quantity | Primary Color | Secondary Color |
---|---|---|---|---|
Casing | 210 | 3 | Red | Red |
Side Panel | 85.4 | 2 | Yellow | Blue |
Railing | 499 | 1 | Black | Orange |
Frame | 387.9 | 1 | Blue | Teal |
Support | 152.5 | 2 | Blue | Blue |
Chassis | 1275.75 | 1 | Black | Black |
The array returned by the rule SppTableFilterByColumnComparison(DwLookupPartDetails,4,5,TRUE) will look like:
Part | Price | Quantity | Primary Color | Secondary Color |
---|---|---|---|---|
Casing | 210 | 3 | Red | Red |
Support | 152.5 | 2 | Blue | Blue |
Chassis | 1275.75 | 1 | Black | Black |
The array returned by the rule SppTableFilterByColumnComparison(DwLookupPartDetails,4,5,FALSE) will look like:
Part | Price | Quantity | Primary Color | Secondary Color |
---|---|---|---|---|
Side Panel | 85.4 | 2 | Yellow | Blue |
Railing | 499 | 1 | Black | Orange |
Frame | 387.9 | 1 | Blue | Teal |