17.05 - MovingAverage Syntax Elements - Teradata Database

Teradata Vantage™ - Advanced SQL Engine Analytic Functions

prodname
Advanced SQL Engine
Teradata Database
vrm_release
17.00
17.05
created_date
June 2020
category
Programming Reference
featnum
B035-1206-170K
MAvgType
[Optional] Specify one of the following moving average types:
Type Description
'C' (Default) Cumulative moving average.
'E' Exponential moving average.
'M' Modified moving average.
'S' Simple moving average.
'T' Triangular moving average.
'W' Weighted moving average.
TargetColumns
[Optional] Specify the input column names for which to compute the moving average.
Default behavior: The function copies every input column to the output table but does not compute any moving averages.
Alpha
[Optional with MAvgType E, otherwise ignored.] Specify the damping factor, a value in the range [0, 1], which represents a percentage in the range [0, 100]. For example, if alpha is 0.2, the damping factor is 20%. A higher alpha discounts older observations faster.
Default: 0.1
StartRows
[Optional with MAvgType E, otherwise ignored.] Specify the number of rows to skip before calculating the exponential moving average. The function uses the arithmetic average of these rows as the initial value of the exponential moving average. The value n must be an integer.
Default: 2
IncludeFirst
[Ignored with MAvgType C, otherwise optional.] Specify whether to include the starting rows in the output table. If you specify 'true', the output columns for the starting rows contain NULL, because their moving average is undefined.
Default: 'false'
WindowSize
[Optional with MAvgType M, S, T, and W; otherwise ignored.] Specify the number of previous values to consider when computing the new moving average. The data type of window_size must be BYTEINT, SMALLINT, or INTEGER.
Minimum value: 3
Default: '10'