TD_GENSERIES4SINUSOIDS Function Example | Teradata Vantage - TD_GENSERIES4SINUSOIDS Example - 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

TD_GENSERIES4SINUSOIDS Input Table

TD_TIMECODE ProductID SeqNO BEER_SALES
2022-02-28 08:00:01 33 1 1.2
2022-02-28 08:00:02 33 2 5.6
2022-02-28 08:00:03 33 3 7.2
2022-02-28 08:00:04 33 4 2.5
2022-02-28 08:00:05 33 5 4.1
2022-02-28 08:00:06 33 6 8.9

Example: Using TD_GENSERIES4SINUSOIDS to Determine Periodic Patterns of Sales Call

EXECUTE FUNCTION INTO VOLATILE ART (GEN_SERIES)
  TD_GENSERIES4SINUSOIDS (
    SERIES_SPEC (
      TABLE_NAME (ProductionData),
      ROW_AXIS (TIMECODE (TD_TIMECODE)),
      SERIES_ID (ProductID),
      PAYLOAD (FIELDS (BEER_SALES), CONTENT (REAL))
    ),
    FUNC_PARAMS (PERIODICITIES (0.523, 1.4367)),    
    OUTPUT_FMT (INDEX_STYLE (FLOW_THROUGH))
  );

TD_GENSERIES4SINUSOIDS Result

Display the primary RETURNS TABLE with this statement:

SELECT * FROM GEN_SERIES;
PRODUCTID  ROW_I                MAGNITUDE_BEER_SALES
---------  -------------------  --------------------
33         2022-02-28 08:00:01  3.03997500489156E-001
33         2022-02-28 08:00:02  9.73148057870269E 000
33         2022-02-28 08:00:03  1.27993913808874E 001
33         2022-02-28 08:00:04  7.24762870417679E 000
33         2022-02-28 08:00:05  1.01006444191279E 001
33         2022-02-28 08:00:06  1.16310641441795E 001