Moving average

This Moving average step smooths out short-term fluctuations in your data by calculating averages over a specified window of time or number of rows. It's particularly helpful for identifying trends in time-series data.

Step parameters

  • Value column column(string): the value column used as the basis for the moving average computation

  • Reference column to sort (usually dates) column(string): the column used to sort rows

  • Moving window (in number of rows) int*: the number of rows included in the moving window

  • Group by (optional): if you want perform the computation by group of rows (see example 2 below)

  • New column name (optional): if you want to specify a custom column name (by default, it will be your original value column name suffixed with _MOVING_AVG)

Example

Input

Compute - Moving average input

Configuration

{
    "value_col": "sales",
    "column_to_sort": "date",
    "moving_window": 3,
    "group_by": [],
    "new_column_name": "sales_moving_avg"
}

Output

Compute - Moving average output

Last updated

Was this helpful?