0
0
Tableaubi_tool~10 mins

Year-over-year comparison 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 the sales for the previous year using Tableau's LOOKUP function.

Tableau
LOOKUP(SUM([Sales]), [1])
Drag options to blanks, or click blank then click option'
A0
B1
C-1
D2
Attempts:
3 left
💡 Hint
Common Mistakes
Using positive offset like 1 which looks forward instead of backward.
Using 0 which returns the current row value.
2fill in blank
medium

Complete the calculation to find the year-over-year sales growth percentage.

Tableau
(SUM([Sales]) - [1]) / ABS([1])
Drag options to blanks, or click blank then click option'
ALOOKUP(SUM([Sales]), -1)
BTOTAL(SUM([Sales]))
CAVG([Sales])
DSUM([Sales])
Attempts:
3 left
💡 Hint
Common Mistakes
Using current year's sales instead of previous year's sales in the formula.
Dividing by current year's sales instead of previous year's sales.
3fill in blank
hard

Fix the error in this calculation that attempts to compute year-over-year sales difference but returns incorrect results.

Tableau
SUM([Sales]) - [1]
Drag options to blanks, or click blank then click option'
ASUM([Sales])
BLOOKUP(SUM([Sales]), -1)
CLOOKUP(SUM([Sales]), 1)
DPREVIOUS_VALUE(SUM([Sales]))
Attempts:
3 left
💡 Hint
Common Mistakes
Using positive offset which looks forward instead of backward.
Using PREVIOUS_VALUE which does not behave as expected here.
4fill in blank
hard

Fill both blanks to create a calculation that returns the year-over-year sales growth percentage formatted as a percentage.

Tableau
IFNULL(ROUND((SUM([Sales]) - [1]) / ABS([2]) * 100, 2), 0) + '%'
Drag options to blanks, or click blank then click option'
ALOOKUP(SUM([Sales]), -1)
BSUM([Sales])
DAVG([Sales])
Attempts:
3 left
💡 Hint
Common Mistakes
Using current year's sales in one or both blanks.
Using different functions for the two blanks causing errors.
5fill in blank
hard

Fill all three blanks to create a calculation that returns the year-over-year sales growth ratio, handles division by zero, and formats the result as a percentage string.

Tableau
IF(ABS([1]) > 0, STR(ROUND((SUM([Sales]) - [2]) / ABS([3]) * 100, 1)) + '%', 'N/A')
Drag options to blanks, or click blank then click option'
ALOOKUP(SUM([Sales]), -1)
DSUM([Sales])
Attempts:
3 left
💡 Hint
Common Mistakes
Using current year's sales in any blank causing incorrect calculations.
Not handling division by zero properly.