Interpolator Example 2: Constant Interpolation - 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™

SQL Call

SELECT * FROM Interpolator (
  ON company1_stock1 AS input_table PARTITION BY id ORDER BY period
  USING
  TimeColumn ('period')
  TimeInterval (86400)
  ValueColumns ('stockprice')
  InterpolationType ('constant') 
  ValuesBeforeFirst (0)
  ValuesAfterLast (0)
  Accumulate ('id')
) AS dt;

Output

id period stockprice
1 1961-05-17 00:00:00 460
1 1961-05-18 00:00:00 457
1 1961-05-19 00:00:00 452
1 1961-05-20 00:00:00 452
1 1961-05-21 00:00:00 459
1 1961-05-22 00:00:00 459
1 1961-05-23 00:00:00 462
1 1961-05-24 00:00:00 459
1 1961-05-25 00:00:00 463
1 1961-05-26 00:00:00 479
1 1961-05-27 00:00:00 479
1 1961-05-28 00:00:00 493
1 1961-05-29 00:00:00 493
1 1961-05-30 00:00:00 493
1 1961-05-31 00:00:00 490
1 1961-06-01 00:00:00 492
1 1961-06-02 00:00:00 498
1 1961-06-03 00:00:00 498
1 1961-06-04 00:00:00 499
1 1961-06-05 00:00:00 499
1 1961-06-06 00:00:00 497
1 1961-06-07 00:00:00 496
1 1961-06-08 00:00:00 490
1 1961-06-09 00:00:00 489
1 1961-06-10 00:00:00 489
1 1961-06-11 00:00:00 478
1 1961-06-12 00:00:00 478
... ... ...