Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to calculate the total sales using an aggregate function.
Tableau
SUM([1]) Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using AVG or COUNT inside SUM causes errors or wrong results.
Leaving the field name blank.
✗ Incorrect
The SUM function adds all values in the Sales field to give total sales.
2fill in blank
mediumComplete the code to calculate the average sales per row.
Tableau
AVG([1]) Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Putting SUM(Sales) inside AVG causes wrong calculation.
Using COUNT instead of the field name.
✗ Incorrect
The AVG function calculates the average of the Sales field values.
3fill in blank
hardFix the error in the calculation to get the total sales per category.
Tableau
SUM([1]) Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Trying to sum a text field like Category.
Using COUNT or AVG inside SUM.
✗ Incorrect
To get total sales per category, sum the Sales field, not the Category field.
4fill in blank
hardFill both blanks to calculate the average sales per region, excluding zero sales.
Tableau
AVG(IF [1] > 0 THEN [2] END)
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using Region or Category in the condition or average instead of Sales.
Not excluding zero sales properly.
✗ Incorrect
The condition checks if Sales > 0, then averages the Sales values.
5fill in blank
hardFill all three blanks to create a calculation that sums sales only for the 'East' region.
Tableau
SUM(IF [1] = '[2]' THEN [3] ELSE 0 END)
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using Category instead of Region in the condition.
Using Category instead of Sales to sum.
Not quoting the region name 'East'.
✗ Incorrect
This calculation sums Sales only when Region equals 'East'. Otherwise, it adds zero.