Moving window formulas video

## Overview

Explains what the feature is or what its benefits are to the user or customer.

## Feature

You can use the moving formulas to compute a measure within a moving window of your data, usually defined by time.

This example will demonstrate using the moving_average formula. To use the moving function in a search:

- Start a new search.
Figure: Aggregation Answer example

- In the upper right hand side of the table, click Actions and select Add formula.
Figure: Create a new formula in an answer

- Enter the moving_average formula, providing a measure, a window, and one or more attributes. The example will return the average of revenue, within the commit date window size of 3. The window includes the previous, current, and next rows.
The attributes are the ordering columns used to compute the moving average. The window is (current - Num1...Current + Num2) with both end points being included in the window. For example, "1,1" will have a window size of 3. To see periods in the past, use a negative number for the second endpoint, as in the example "moving_average(sales, 1, -1, date)".

Figure: Moving Average Formula

- Name the formula by clicking on its title and typing the new name. Click Save.
- The formula will appear in the search bar and in the table as its own column.
Figure: Moving Average Table

A box displaying the moving average within the entire table will appear at the bottom. You can click on it to toggle between aggregation types.