TSPrevious function
The TSPrevious function records the supplied argument and returns the last argument it was passed.
Syntax
TSPrevious(value int)
returns int;
TSPrevious(value smallfloat)
returns smallfloat;
TSPrevious(value double precision)
returns double precision;
- value
- The value to save.
Description
Use the TSPrevious function within the Apply function.
TSPrevious function is useful in comparing a value in a time series with the value immediately preceding it. The TSPrevious function can take parameters that are columns of a time series. Use the same parameter format that the Apply function accepts.
Returns
The value previously saved. The
first time TSPrevious is called, it returns NULL
.
Example
See the example for the TSCmp function.