Using AVG Instead of MAVG
The use of MAVG is strongly discouraged. MAVG is a Teradata extension to the ANSI SQL:2011 standard, and is equivalent to the ANSI-compliant AVG window function that specifies ROWS value PRECEDING as its aggregation group. MAVG is retained only for backward compatibility with existing applications.
MAVG and Missing Data Points
Make sure that data you analyze using MAVG has no missing data points. Computing a moving average over data with missing points produces unexpected and incorrect results because the computation considers n physical rows of data rather than n logical data points.
Computing the Moving Average When Number of Rows is Less Than width
For the (possibly grouped) resulting relation, the moving average considering width rows is computed where the rows are sorted by the sort_expression list.
When there are fewer than width rows, the average is computed using the current row and all preceding rows.