Table Lookup

Search for a value in a table (the "lookup value") and retrieve a corresponding value. You can choose to retrieve the following types of values:

  • The location of the lookup value (identified by its row and column numbers)

  • All the values in the lookup value's row

  • All the values in the lookup value's column

  • A single value from a specific column in the lookup value's row

  • A single value from a specific row in the lookup value's column

  1. Enter the name of the variable in which the table is stored.

  2. Enter the delimiters that separate each column and row.

  3. Choose whether to look for:

    1. A single value matching the lookup criteria specified in 4, 5 & 6

    2. All values that match the lookup criteria specified in 4, 5 & 6

      If you select option a (a single value) and more than one matching value is found, the multiple lookup values found error will be returned in the error variable and the output variable will be returned as empty.

  4. Select the condition for finding the lookup value:

    • equals (with options to ignore letter case/use wildcards/allow close match)

    • contains (with option to ignore letter case/allow close match)

    • match regular expression (with option to ignore letter case)

    • is greater than

    • is greater than or equal to

    • is less than

    • is less than or equal to

    • begins with (with option to ignore letter case)

    • ends with (with option to ignore letter case)

    • is empty

    • is defined

  5. Enter the lookup value.

  6. Select whether to search for the lookup value in the entire table, in a specific column, or in a specific row; and

    Provide the column/row number in which to search (where relevant).

  7. Select the value to return and provide additional information as required (varies by the type of value to return).

  8. Address (column & row):

    The wizard will return the location of the lookup value.

    • Enter the name(s) of the variable(s) in which to return the value(s) retrieved.

      • If you have selected option a in 3 (a single matching value), specify separate variables for returning column and row numbers.

      • If you have selected option b in 3 (multiple matching values), specify a single output variable.

    Entire row:

    The wizard will return all the values in the lookup value's row

    • Enter the name of the variable in which to return the values retrieved

    Entire column:

    The wizard will return all the values in the lookup value's column.

    • Enter the name of the variable in which to return the values retrieved.

    A value from a specific column in the same row:

    • Select whether you want the wizard to return:

      1. The value from the last column in the lookup value's row; or

      2. The value from a specific column in the lookup value's row (and enter the column number)

    • NOTE: This should be the actual column number, NOT the column's position relative to the lookup value

    • Enter the name of the variable in which to return the value(s) retrieved.

    A value from a specific row in the same column:

    • Select whether you want the wizard to return:

      1. The value from the last row in the lookup value's column; or

      2. The value from a specific row in the lookup value's column (and enter the row number)

    • NOTE: This should be the actual row number, NOT the row's position relative to the lookup value

    • Enter the name of the variable in which to return the value(s) retrieved

    The matching value itself:

    The wizard will return the matching value(s) that meet the lookup criteria.

    • Enter the name of the variable in which to return the values retrieved.

    EXAMPLE: When would you use this option?

    Returning the matching value itself is useful when you want to retrieve:

    • all values that match the lookup condition; and

    • the lookup condition is something other than equals

    Say, for example, your table contains transaction data, and you want to find the amounts all transactions greater than $10,000. You could set this command to:

    • find all matching values greater than $10,000; and

    • return the matching value itself

  9. Instruct the wizard how to handle any errors encountered. Read more about error handling.

When relevant, values retrieved will be separated using the row and column delimiters you specified in 2.