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

DWHLookup

Returns a value from a table corresponding to a match found in the specified row.

Syntax

DWHLookup( [Value], [ Table Name], [ Lookup Row], [ Result Row Index], [ MatchType] )

Value is the value to be found.

Table Name is the table within which the value is to be found.

Lookup Row is the number of the row containing the data to be searched for.

Result Row Index is the number of the row containing the data to be returned.

MatchType defines whether the match has to be exact (False) or the nearest found (True).

Examples

Rule

Meaning
DWHLookup(CarColourComboBoxReturn, Vehicles, 3, 2, FALSE)The function looks in the Vehicles table for a match, in the third row of the table, to the value returned from the CarColourComboBox. If a match is found, the function then looks up to the second row and returns the value in the same column as the match found. The user has also specified that the match needs to be exact (denoted by the FALSE term). In this case, the Car Colour selected in the combo box is "Blue", so the function returns "Golf".

Example Outcomes

Lookup

In

Lookup Row

Result Row Index

MatchType

Outcome

"Blue"Vehicles32False (Exact)"Golf"
"White"Vehicles31False (Exact)"Renault"
26People32True (Nearest)"Dave Sharp"
42People34False (Exact)"Female"

Example Data

Vehicles Table

MakeVolkswagenFordRenaultMazda
ModelGolfEscortKangoo2
ColourBlueRedWhiteBlack

People Table

Member ID424496107251
NameDave SharpJoe BloggsSandra ShieldThomas KnightIsabelle Jones
Age2537422156
GenderMaleMaleFemaleMaleFemale

Table of Contents