About Lookup Files
Traditionally a lookup file is a delimited text file that contains columns of data that you can join to core dimensions as Info Fields. You can generate a lookup file using a spreadsheet, text editor, or relational database. A lookup file contains dimension values in one column and associated Info Fields in additional columns.
If the information in an Info Field is subject to frequent changes, it might be beneficial to keep the information in an external lookup file so that you can update this data without having to rebuild the main model. It is easier to specify lookups and named group lookups when you build a DivePlan rather than after the fact.
NOTE: In addition to text files, the Model engine can use mdl and tnl files as the lookup source. With the Spectre engine, cbase or cplan files can be used as the lookup source.
The following list is a set of reminders to consider when using lookup files:
- A one-to-one relationship between the dimension column and the lookup column must exist (one row per dimension value)
- A lookup can contain only one dimension column and it must be identical to the dimension in the model or cBase that the lookup file is linked to
- Except for the single dimension column, a lookup can contain multiple columns but they must all be treated as Info Fields
- A lookup text file can include up to 1245 Info Fields; a lookup Model can include up to 4094 Info Fields
- Multiple lookups can be used against a single dimension, but multiple dimensions cannot use the same lookup
- The Diver client treats a lookup field as either a string or a number (no dates)
- A lookup field for a core dimension defined as a date needs to have the same column name but its contents need to contain the integer date value used by Diver to store dates internally (for example, 41234; not 2012-06-13)
- You can associate a lookup with the "model" dimension in a consolidated DivePlan
- DiveLine clients search for lookup files in the current directory and then in DiveLine search paths
- If you use a Diver client to open a DivePlan that contains a lookup file, Diver loads the file into memory and retains the lookup values only for the duration of the client session
You can add a lookup file to a dimension using the "L" (for Lookup) feature in DiveMaster. An "L" in a row cell indicates that there is
a lookup file associated with a dimension.
The Sales Region dimension in the figure above uses
a lookup text file as a source for new Info Fields.
The highlighted row in the lookup file contains Info Field values of Sales Region, Sales Manager, and Regional Phone Number. For example, in the Boston sales region, the Sales Manager is Joe Red and the Regional Phone Number 617-229-1213.
See Creating a Lookup Text File for information about how to properly configure the text file.
If you encounter the error "Unable to validate the file <model file name>", there are two possible causes:
1. The lookup dimension is missing from either the input file or the lookup file. In the case of a consolidated DivePlan, the first input file is expected to contain the lookup dimension.
2. There is an encoding mismatch in which the lookup dimension contains a special character. The input file and the lookup file are required to use the same encoding for the lookup to work.