SERIES_SPEC Element Examples | Teradata Vantage - SERIES_SPEC Examples - Teradata Vantage

Database Unbounded Array Framework Time Series Functions

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2024-10-04
dita:mapPath
ncd1634149624743.ditamap
dita:ditavalPath
ruu1634160136230.ditaval
dita:id
ncd1634149624743

Example: Using SERIES_SPEC with TD_LINEAR_REGR

EXECUTE FUNCTION INTO VOLATILE ART(ArtTable)
TD_LINEAR_REGR (
   SERIES_SPEC (
      TABLE_NAME (HOUSE_VALUES),
      ROW_AXIS (SEQUENCE (S_NO)),
      SERIES_ID (CID),
      PAYLOAD (
         FIELDS (HOUSE_VALUE, SALARY), CONTENT (MULTIVAR_REAL)
      ),
      FUNC_PARAMS(
          FORMULA('Y = c + a*X1'),
          ALGORITHM('QR'),
          VARIABLES_COUNT(2),
          WEIGHTS(0),
          COEFF_STATS(1),
          MODEL_STATS(1),
          RESIDUALS(1)
      )  
   )
); 

Example: Using SERIES_SPEC with TD_SEASONALNORMALIZE

TD_SEASONALNORMALIZE(
     SERIES_SPEC(
         TABLE_NAME(StoreSales),
         ROW_AXIS(TIMECODE(TD_TIMECODE)),
         SERIES_ID(StoreID),
         PAYLOAD(
            FIELDS(Sales), CONTENT(REAL)
         ),
         INTERVAL(CAL_MONTHS(1))
     ),
     FUNC_PARAMS(
       SEASON_CYCLE(CYCLES("CAL_YEARS"), DURATION(1))
     )
);