PutTimeSeries function
The PutTimeSeries function puts every element of the first time series into the second time series.
Syntax
PutTimeSeries(ts1 TimeSeries,
ts2 TimeSeries,
flags integer default 0)
returns TimeSeries;
- ts1
- The time series to be inserted.
- ts2
- The time series into which the first time series is to be inserted.
- flags
- Valid values for the flags argument are described in The flags argument values. The default is
0
.
Description
If both time series contain data at the same timepoint, the rule of PutElem is followed (see PutElem function), unless the TS_PUTELEM_NO_DUPS value of the flags parameter is set.
Both time series must have the same calendar. Also, the origin of the time series that is specified by the first argument must be later than or equal to the origin of the time series that is specified by the second argument.
Elements are added to the second time series by calling ts_put_elem() (if the TS_PUTELEM_NO_DUPS value of the flags parameter is not set).
The API equivalent of this function is ts_put_ts().
Returns
A version of the second time series into which the first time series was inserted.
Example
update activity_stocks
set activity_data = PutTimeSeries(activity_data, 'calendar(daycal),
irregular'::TimeSeries(stock_trade))
where stock_id = 600;