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

Syntax

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

Lists 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

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

Or

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

The function looks in the Vehicles table, and retrieves all the data in the first column where the data in column 3 equals Red. In this case, that first column contains car makes, so the list; "Ford|Mazda" is returned.
LISTALLCONDITIONAL(People, 2,3,">30")The function looks in the People table, and retrieves all the data in the second column where the values in column 3 are greater than 30. In this case, that second column contains Names, so the list; "Joe Bloggs|Sandra Shield|Isabelle Jones" is returned.
LISTALLCONDITIONAL(People, 2,3,">30",4,"Female")The function looks in the People table, and retrieves all the data in the second column where the values in column 3 are greater than 30 and also where the values in column 4 equal Female (note the = symbol is not required). In this case, that second column contains Names, so the list; "Sandra Shield|Isabelle Jones" is returned.

Example Outcomes

Table

Column

ConditionColumn1

Condition1

ConditionColumn2

Condition2

Outcome
Vehicles13"=Red""Ford|Mazda"
People23">30""Joe Bloggs|Sandra Shield|Isabelle Jones"
People23">30"4"=Female""Sandra Shield|Isabelle Jones"

Example Data

Vehicles Table

MakeModelColourMileage
VolkswagenGolfBlue40000
FordEscortRed55000
RenaultKangooWhite37000
FordMondeoRed28000
Mazda2Red82000
VolkswagenGolfSilver110000
VolkswagenPoloBlue72000
FordMondeoRed54000
RenaultLagunaBlack46000

People Table

Member IDNameAgeGender
42Dave Sharp25Male
44Joe Bloggs37Male
96Sandra Shield42Female
107Thomas Knight21Male
251Isabelle Jones56Female

Table of Contents