Please enable JavaScript to view this site.

Vensim Help

Navigation: Reference Guide > Functions > Data Functions

GET DIRECT LOOKUPS('file','tab','time row or col','cell') GET LOOKUPS DIRECTly from a file

Scroll Prev Top Next More

Returns time series data from a file for a Lookup variable or a vector of Lookup variables.

Restrictions: Must appear directly following the equals sign = and not be followed by anything.  

The GET DIRECT LOOKUPS function is invoked during simulation setup, before the active simulation begins.

Vensim will need to open the file to read it. This means the file must not be opened in another application. This function supports Microsoft Excel (.xls or .xlsx) files. It also supports text files that contain delimited data. By default Vensim will look for tab delimited data unless the extension on the  file is .csv in which case Vensim will look for comma delimited values. You can specify an alternative delimiting character in the second argument to the function when opening plain text files.

All of the arguments to GET DIRECT LOOKUPS must be literals (enclosed in single quotes ') or String Variables. 'file' names a file with complete extension to read from (use '?Tag' to indirectly reference a file and resolve the reference in Model>Settings>XLS Files).  It should be in the same directory as the current mode. 'tab' names the tab that contains the Lookups for Excel files or the delimiter for text files. 'time row or col'  is either the number of the row containing Time values (Time running across) or the letter of the column containing Time values (Time running down).  The convention of column letters beginning with A and row numbers beginning with 1 is used for all file types. 'cell'  names the cell that the first Data value is on.  Vensim will read values for different times across or down depending on the 'time row or col' argument.  Vensim will also read additional subscript elements in the other direction.

NOTES

       This function does not open Excel, and may fail if the file is opened in Excel or another application.
Vensim will continue to read the Time row or column to the end of the file, ignoring any blank or nonnumeric cells.
Changes to String Variables made in .cin files (or through Venapp commands) will not be used when determining file, tab or cell.

 

Units: GET DIRECT LOOKUPS is not part of units checking.  Specify units for the Lookup output.

Example

See GET DIRECT DATA

NOTE On the Macintosh GET XLS DATA and GET DIRECT DATA are the same.

Availability:  Not PLE.

See also: GET XLS LOOKUPS, GET DIRECT DATA.

Sample model: GET DIRECT LOOKUPS.mdl in FunctionExamples