TD_UNDIFF Function Example | Teradata Vantage - TD_UNDIFF 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_UNDIFF Input Tables

Input Table DIFF_RESULTS
BuoyID ROW_I OUT_Mag
33 0 19.0
33 1 13.0
33 2 7.0
33 3 15.0
33 4 5.0
... ... ...
Input Table BuoyData
BuoyDI SeqNo Mag
33 1 1
33 2 20
33 3 33
33 4 40
33 5 55
... ... ...

Example: TD_UNDIFF Call

EXECUTE FUNCTION INTO VOLATILE ART(UNDIFF_RESULTS)
TD_UNDIFF(
   SERIES_SPEC(TABLE_NAME(DIFF_RESULTS),SERIES_ID(BuoyId), ROW_AXIS(SEQUENCE(ROW_I)),
      PAYLOAD(FIELDS(MAG), CONTENT(REAL))),
   SERIES_SPEC(TABLE_NAME(BuoyData2),SERIES_ID(BuoyId), ROW_AXIS(SEQUENCE(SeqNo)),
      PAYLOAD(FIELDS(Mag), CONTENT(REAL))),
   FUNC_PARAMS(LAG(1),DIFFERENCES(1) SEASONAL_MULTIPLIER(0)),
 
INPUT_FMT(INPUT_MODE(MATCH))
);

TD_UNDIFF Output

BuoyId ROW_I OUT_Mag
----------- ----------- ----------------------
33 0 1.00000000000000E 000
33 1 2.00000000000000E 001
33 2 3.30000000000000E 001
33 3 4.00000000000000E 001
33 4 5.50000000000000E 001
33 5 6.00000000000000E 001
...