0
0
Tableaubi_tool~10 mins

Rank calculations 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 rank of sales in Tableau.

Tableau
RANK_UNIQUE([1])
Drag options to blanks, or click blank then click option'
AMAX([Sales])
BAVG([Sales])
CMIN([Sales])
DSUM([Sales])
Attempts:
3 left
💡 Hint
Common Mistakes
Using AVG or MIN instead of SUM causes incorrect ranking.
Forgetting to aggregate sales before ranking.
2fill in blank
medium

Complete the code to rank sales in descending order.

Tableau
RANK_DENSE([1], 'desc')
Drag options to blanks, or click blank then click option'
ASUM([Sales])
BAVG([Profit])
CMIN([Quantity])
DMAX([Discount])
Attempts:
3 left
💡 Hint
Common Mistakes
Using non-sales fields like Profit or Discount.
Not specifying aggregation before ranking.
3fill in blank
hard

Fix the error in the rank calculation to rank average profit.

Tableau
RANK([1])
Drag options to blanks, or click blank then click option'
AAVG(Profit)
BSUM([Profit])
CAVG([Profit])
DMIN([Profit])
Attempts:
3 left
💡 Hint
Common Mistakes
Missing square brackets around field names.
Using aggregation without brackets causes errors.
4fill in blank
hard

Fill 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'
APARTITION BY
BORDER BY
CRegion
DCategory
Attempts:
3 left
💡 Hint
Common Mistakes
Using ORDER BY instead of PARTITION BY for grouping.
Partitioning by Category instead of Region.
5fill in blank
hard

Fill 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'
ASUM([Profit])
B'desc'
CSegment
DPARTITION BY
Attempts:
3 left
💡 Hint
Common Mistakes
Not aggregating profit before ranking.
Confusing ORDER BY with PARTITION BY.
Using wrong field for partitioning.