1.0 - 8.00 - SAX Example 4: Sliding Window, Character Output - Teradata Vantage

Teradata® Vantage Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
1.0
8.00
Release Date
May 2019
Content Type
Programming Reference
Publication ID
B700-4003-098K
Language
English (United States)

Input

SQL Call

SELECT * FROM SAX (
  ON finance_data3 AS "input" PARTITION BY id ORDER BY period
  USING
  TargetColumns ('expenditure', 'income', 'investment')
  TimeColumn ('period')
  OutputType ('characters') 
  WindowType ('global')
  Accumulate ('id')
) AS dt ORDER BY id;

Output

id value_column period_start period_end saxchar
1 expenditure 1960Q1 1960Q1 a
1 expenditure 1960Q2 1960Q2 a
1 expenditure 1960Q3 1960Q3 a
1 expenditure 1960Q4 1960Q4 a
1 expenditure 1961Q1 1961Q1 b
1 expenditure 1961Q2 1961Q2 b
1 expenditure 1961Q3 1961Q3 b
... ... ... ... ...