0
0
Tableaubi_tool~10 mins

Moving average in Tableau - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to calculate a 3-period moving average using Tableau's WINDOW_AVG function.

Tableau
WINDOW_AVG(SUM([Sales]), -2, [1])
Drag options to blanks, or click blank then click option'
A0
Attempts:
3 left
💡 Hint
Common Mistakes
Using positive numbers for offsets instead of negative for previous rows.
Confusing the start and end offsets.
2fill in blank
medium

Complete the code to calculate a 5-period moving average including the current and previous 4 periods.

Tableau
WINDOW_AVG(SUM([Profit]), [1], 0)
Drag options to blanks, or click blank then click option'
A5
B-5
C4
D-4
Attempts:
3 left
💡 Hint
Common Mistakes
Using -5 instead of -4 for the start offset.
Using positive offsets which look forward instead of backward.
3fill in blank
hard

Fix the error in the moving average calculation to correctly compute a 7-day moving average.

Tableau
WINDOW_AVG(SUM([Quantity]), [1], 0)
Drag options to blanks, or click blank then click option'
A6
B-6
C-7
D7
Attempts:
3 left
💡 Hint
Common Mistakes
Using -7 which excludes the current day.
Using positive offsets which look forward.
4fill in blank
hard

Fill both blanks to calculate a centered 3-period moving average (one previous, current, and one next period).

Tableau
WINDOW_AVG(SUM([Revenue]), [1], [2])
Drag options to blanks, or click blank then click option'
A-1
B0
C1
D2
Attempts:
3 left
💡 Hint
Common Mistakes
Using 0 for both offsets which only includes the current row.
Using offsets that are not symmetric.
5fill in blank
hard

Fill all three blanks to calculate a moving average of [Sales] over the last 4 periods excluding the current period.

Tableau
WINDOW_AVG(SUM([1]), [2], [3])
Drag options to blanks, or click blank then click option'
A[Sales]
B-4
C-1
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Including the current period by using 0 as end offset.
Using the wrong field inside SUM.