0
0
Tableaubi_tool~10 mins

LOD with date dimensions 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 total sales fixed at the year level.

Tableau
{ FIXED YEAR([1]) : SUM([Sales]) }
Drag options to blanks, or click blank then click option'
ARegion
B[Customer ID]
C[Order Date]
DProduct
Attempts:
3 left
💡 Hint
Common Mistakes
Using a non-date field like Customer ID or Region inside YEAR() causes errors.
Not using a date field will not fix the aggregation by year.
2fill in blank
medium

Complete the code to calculate average sales fixed at the month level.

Tableau
{ FIXED DATETRUNC('month', [1]) : AVG([Sales]) }
Drag options to blanks, or click blank then click option'
A[Customer Name]
B[Ship Date]
CCategory
D[Order Date]
Attempts:
3 left
💡 Hint
Common Mistakes
Using non-date fields like Category or Customer Name inside DATETRUNC.
Using Ship Date instead of Order Date if the question specifies order timing.
3fill in blank
hard

Fix the error in the LOD expression to calculate total profit fixed at the quarter level.

Tableau
{ FIXED DATETRUNC('quarter', [1]) : SUM([Profit]) }
Drag options to blanks, or click blank then click option'
A[Order Date]
BCategory
C[Ship Date]
DRegion
Attempts:
3 left
💡 Hint
Common Mistakes
Using DATEPART('quarter', ...) inside FIXED causes incorrect partitioning across years.
Using non-date fields inside FIXED.
4fill in blank
hard

Fill both blanks to calculate total sales fixed at the year and region level.

Tableau
{ FIXED [1], [2] : SUM([Sales]) }
Drag options to blanks, or click blank then click option'
AYEAR([Order Date])
BRegion
CCategory
DCustomer ID
Attempts:
3 left
💡 Hint
Common Mistakes
Using non-date fields for the year dimension.
Using Category or Customer ID instead of Region.
5fill in blank
hard

Fill all three blanks to calculate average profit fixed at the month, category, and region level.

Tableau
{ FIXED [1], [2], [3] : AVG([Profit]) }
Drag options to blanks, or click blank then click option'
ADATETRUNC('month', [Order Date])
BCategory
CRegion
DCustomer Name
Attempts:
3 left
💡 Hint
Common Mistakes
Using Customer Name instead of Category or Region.
Not truncating the date to month level.