Question: how to calculate weighted average in teradata?
Answer: TotalM+1 = TotalM + VM+1 - V(M-n+1)
NumeratorM+1 = NumeratorM + n*VM+1 - TotalM.
WMAM+1 = NumeratorM+1 / (n*(n+1)/2)