Please enable JavaScript to view this site.

Vensim Help

Using variable IDs is likely to be generally useful, especially for time series data.  It allows you to have one table to store information about a variable and second table to store the actual values with an arbitrary unique identifier identifying which variables values in the second table belong to.  The following example is identical to the previous one except that variable IDs are used to mark all the tables containing values.

:CONNECT DATA1

:DATA

:VARID id

:TIME TimeValue

:VALUE DataValue

:SELECT DATA_VALS

:LOOKUPS

:VARID id

:X x

:Y y

:SELECT LOOKUP_VALS

:CONSTANTS

:VARID id

:VALUE ConstantValue

:SELECT CONSTANT_VALS

:VARLOOKUP

:VARID id

:VARNAME varname

:SUB sub1

:SELECT VARIABLES

In this example the data is read in for the different Data, Constants and Lookups but the :VARLOOKUP section is needed to map those values to variables in the model.  For input files it does not matter whether the :VARLOOKUP section goes before or after the other sections.  However, for output files the VARLOOKUP section must go first.