DriveWorks Solo 15: ListAllConditionalDistinct [send feedback...]

Syntax

LISTALLCONDITIONALDISTINCT( [ Table], [ Column] , [ConditionColumn1] , [Condition1] )

Lists distinct values from a table’s column, where specified conditions are met for each row.

The table is the table from which to retrieve the data.

Column is the number of the column within the table to retrieve the data from.

ConditionColumn is the number of the column within the table to filter the data on.

Condition is an expression that when met will include the data from the column.

Multiple Conditions are separated by a comma and must start with the column number followed by the condition, as below:

, [ConditionColumn2] , [Condition2]

DriveWorks projects have no limit on the amount of ConditionColumn and Condition arguments.

Examples

Rule

Meaning

LISTALLCONDITIONALDISTINCT(Vehicles, 1,3,"=Red")

Or

LISTALLCONDITIONALDISTINCT(Vehicles, 1,3,"Red")

The function looks in the Vehicles table, and retrieves all the data in the first column, where the third column equals red. In this case, that first column contains car makes, so the list; "Ford|Mazda" is returned.
LISTALLCONDITIONALDISTINCT(Vehicles, 2,4,"<60000",3,"=Red")

The function looks in the Vehicles table, and retrieves all the data in the second column, where the fourth column is less than 60000 miles and the third column equals red. In this case, that second column contains car models, so the list; "Escort|Mondeo" is returned.

Example Outcomes

Table

Column

ConditionColumn1

Condition1

ConditionColumn2

Condition1

Outcome

Vehicles13"=Red""Ford|Mazda"
Vehicles24"<60000"3"=Red""Escort|Mondeo"

Example Data

Vehicles Table

MakeModelColourMileage
VolkswagenGolfBlue40000
FordEscortRed55000
RenaultKangooWhite37000
FordMondeoRed28000
Mazda2Red82000
VolkswagenGolfSilver110000
VolkswagenPoloBlue72000
FordMondeoRed54000
RenaultLagunaBlack46000

Table of Contents