Complete the code to calculate the sales for the previous year using Tableau's LOOKUP function.
LOOKUP(SUM([Sales]), [1])The LOOKUP function with offset -1 returns the value from the previous row, which corresponds to the previous year in a year-over-year comparison.
Complete the calculation to find the year-over-year sales growth percentage.
(SUM([Sales]) - [1]) / ABS([1])
To calculate year-over-year growth, subtract the previous year's sales (using LOOKUP with offset -1) from the current year's sales, then divide by the absolute value of the previous year's sales.
Fix the error in this calculation that attempts to compute year-over-year sales difference but returns incorrect results.
SUM([Sales]) - [1]The correct way to get the previous year's sales is using LOOKUP with offset -1. Using offset 1 looks forward, causing incorrect results.
Fill both blanks to create a calculation that returns the year-over-year sales growth percentage formatted as a percentage.
IFNULL(ROUND((SUM([Sales]) - [1]) / ABS([2]) * 100, 2), 0) + '%'
Both blanks require the previous year's sales value using LOOKUP with offset -1 to calculate the growth percentage correctly.
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.
IF(ABS([1]) > 0, STR(ROUND((SUM([Sales]) - [2]) / ABS([3]) * 100, 1)) + '%', 'N/A')
All blanks require the previous year's sales value using LOOKUP with offset -1 to correctly compute the growth ratio and handle division safely.