Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to calculate the rank of sales in Tableau.
Tableau
RANK_UNIQUE([1]) Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using AVG or MIN instead of SUM causes incorrect ranking.
Forgetting to aggregate sales before ranking.
✗ Incorrect
We use SUM([Sales]) inside RANK_UNIQUE() to rank total sales values uniquely.
2fill in blank
mediumComplete the code to rank sales in descending order.
Tableau
RANK_DENSE([1], 'desc')
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using non-sales fields like Profit or Discount.
Not specifying aggregation before ranking.
✗ Incorrect
Use SUM([Sales]) to rank sales values densely in descending order.
3fill in blank
hardFix the error in the rank calculation to rank average profit.
Tableau
RANK([1]) Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Missing square brackets around field names.
Using aggregation without brackets causes errors.
✗ Incorrect
Tableau requires field names in square brackets. Use AVG([Profit]) for correct syntax.
4fill in blank
hardFill both blanks to rank sales by category and reset rank for each region.
Tableau
RANK_UNIQUE(SUM([Sales]), [1] = '[2]')
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using ORDER BY instead of PARTITION BY for grouping.
Partitioning by Category instead of Region.
✗ Incorrect
Use PARTITION BY Region to reset rank for each region.
5fill in blank
hardFill all three blanks to rank profit descending, partitioned by segment, ordered by profit.
Tableau
RANK_DENSE([1], [2] = '[3]')
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Not aggregating profit before ranking.
Confusing ORDER BY with PARTITION BY.
Using wrong field for partitioning.
✗ Incorrect
Rank profit descending, partition by segment using RANK_DENSE(SUM([Profit]), PARTITION BY = 'Segment').