MovingAverage Syntax Elements - Teradata® Database

Database Analytic Functions

Product
Teradata® Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-28
dita:mapPath
Teradata_Vantage™___Advanced_SQL_Engine_Analytic_Functions.withLogo_upload_July2021/wnd1589838592459.ditamap
dita:ditavalPath
Teradata_Vantage™___Advanced_SQL_Engine_Analytic_Functions.withLogo_upload_July2021/ayr1485454803741.ditaval
dita:id
B035-1206
lifecycle
previous
Product Category
Teradata Vantage™
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'