**What's in this article?**

- Learn how to use the Moving Average (Simple) function
- Step-by-step instructions
- Example of scenarios where the Moving Average function is useful

## How to use the Moving Average (Simple) function

Moving Average (Simple) returns the moving average of the previous `n`

data points for each of the given `values`

. This function is used to *smooth* out data sets to help clarify trends. For example, if you had a Google Analytics data source that showed website visitors with a significant decrease each weekend, the Moving Average function will help provide a more consistent representation of the data.

**What's the difference?**

Moving Average Simple averages all values specified by the value `n`

at the same vector.

### To use the Moving Average (Simple) function

**Note:** *These procedures assume you are in the Klip Editor.*

- Select a component from the Component Tree.
- Select the
`MA_SIMPLE`

from the Function's menu. - Select a range of values from the data source.
- Supply a value for
*n*.

## Examples

To better understand how the moving average (simple) function works, consider this basic example.

`MA_SIMPLE (7, 6, 3, 9, 5, 10, 2, 8, 1, 4) , 5) `

The result would be as follows:

(7, 6.5, 5.33, 6.25, 6, 6.6, 5.8, 6.8, 5.2, 5)

### Bar / Line Chart

The Moving Average (Simple) function is often used in a bar or line chart to smooth out data sets. Here is an example that shows the raw data (the red line) compared to data manipulated using the Moving Average (Simple) function (the blue line) where `n`

equals 5.