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

Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
8.00
1.0
Published
May 2019
Language
English (United States)
Last Update
2019-11-22
dita:mapPath
blj1506016597986.ditamap
dita:ditavalPath
blj1506016597986.ditaval
dita:id
B700-4003
lifecycle
previous
Product Category
Teradata Vantage™

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
... ... ... ... ...