This article describes how to go from a crosstab with a Date/Time variable set...

...to a table with a *lagged* rolling average:

## Requirements

- A table with a Date/Time variable

Please note these steps require the **Data Stories** module or a **Displayr **license.

## Method

- Select your table.
- Go to
**Data****> RULES**in the**object inspector**. - To apply the rule, select the
**Plus (+) > Modify Whole Table or Plot > Replace with Rolling Averages**. - Set the
**Number of periods to roll**. - OPTIONAL: Tick
**Dates are in the rows**if applicable. - Press
**OK**.

Please note the following:

- A lagged rolling average is computed. For example, if January has a score of 3, February 4, and March 6, the 3-period rolling average for March is (3 + 4 + 6) / 3 = 4.33333333.
- Where values cannot be computed due to insufficient data, the value is shown as
*NaN*. For example, if January has a score of 3, February 4, and March 6, the 3-period rolling average for the three months, respectively, are NaN, NaN, and 4.33333333. - This rule is only applied to the first statistic selected in each of
**STATISTICS > Cells**and whichever is appropriate of**STATISTICS > Below**and**STATISTICS >****Right**. - You may not have a NET in the variable containing the dates.
- The statistical testing results on the table are not changed by this rule. That is, they reflect the results for the original, un-rolled statistics.

## Next