Please enable JavaScript to view this site.

Vensim Help

Navigation: Reference Guide > Functions > Data Functions

GET DATA BETWEEN TIMES(datavar,time,mode) GET DATA value interpolated BETWEEN TIMES

Scroll Prev Top Next More

Returns the value of a data variable at a time using the specified interpolation mode or, or :NA: if the time is before the first or after the last data point.  :NA: is also returned it variable passed as an argument is not a Data variable.  If mode= 0 the value is computed by interpolating.  If mode = 1 the value returned is the later time value (same as :LOOK FORWARD:).  If mode is -1 the value returned is the earlier time value (same as :HOLD BACKWARD:).

Note that GET DATA BETWEEN TIMES is slow compared to other functions on data.  For example GET DATA BETWEEN TIMES(datavar,Time+1,0) is the same as defining an additional data variable

tshift datavar := TIME SHIFT(datavar,1)

and then using that tshift datavar.  Defining the extra variable will give better performance.

Units: GET DATA BETWEEN TIMES(units,time,dmnl) --> units

Example

sales at time 20 = GET DATA BETWEEN TIMES(sales data,20,0)

Availability: Not PLE or PLE Plus.

See also: TIME SHIFT, Data Equations, :NA:

Sample model: GET DATA BETWEEN TIMES.mdl in FunctionExamples