ValueAsCollection function
The ValueAsCollection function returns a search pattern in a format that you can include in advanced analytics functions.
Syntax
ValueAsCollection (
ts TimeSeries,
begin_tstamp DATETIME YEAR TO FRACTION(5),
end_tstamp DATETIME YEAR TO FRACTION(5),
col_name LVARCHAR)
RETURNS LIST (ROW (value DOUBLE PRECISION) NOT NULL)
ValueAsCollection (
ts TimeSeries,
begin_tstamp DATETIME YEAR TO FRACTION(5),
end_tstamp DATETIME YEAR TO FRACTION(5),
col_num INTEGER)
RETURNS LIST (ROW (value DOUBLE PRECISION) NOT NULL)
- ts
- The time series value for the specified primary key.
- begin_stamp
- The begin point of the range to search. Can be NULL, which represents the first element in the time series.
- end_stamp
- The end point of the range to search. Can be NULL, which represents the last element in the time series.
- col_name
- The name of the column in the TimeSeries data type from which to retrieve the values.
- col_num
- The number of the column in the TimeSeries data type from which to retrieve the values.
Usage
Run the ValueAsCollection function to return a search pattern that you can use as input to an advanced analytics function. A search pattern is the list of values from the specified column in the TimeSeries data type for the specified time range. You can run the ValueAsCollection function within the analytics function as the pattern argument.
Returns
A list of row types that have a DOUBLE PRECISION field.
Example
The following statement returns a search pattern as a list of row types:
SELECT FIRST 1 ValueAsCollection (raw_reads,
'2010-11-10 00:00:00.00000',
'2010-11-10 01:00:00.00000',
1)::LIST(ROW(value DOUBLE PRECISION)
NOT NULL)FROM ts_data; (expression) LIST{ROW(0.092 ),
ROW(0.084 ),ROW(0.09 ),ROW(0.085 ),
ROW(0.088 )}