0
0
Tableaubi_tool~10 mins

Date calculations (DATEDIFF, DATEADD) 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 number of days between Order Date and Ship Date.

Tableau
DATEDIFF('day', [Order Date], [1])
Drag options to blanks, or click blank then click option'
ATODAY()
B[Order Date]
C[Ship Date]
DNOW()
Attempts:
3 left
💡 Hint
Common Mistakes
Using [Order Date] twice, which results in zero difference.
Using TODAY() or NOW() which gives difference from current date, not Ship Date.
2fill in blank
medium

Complete the code to add 3 months to the Order Date.

Tableau
DATEADD('month', [1], [Order Date])
Drag options to blanks, or click blank then click option'
A3
B1
C-3
D12
Attempts:
3 left
💡 Hint
Common Mistakes
Using 1 or 12 which adds wrong number of months.
Using negative number which subtracts months.
3fill in blank
hard

Fix the error in the code to calculate the number of weeks between two dates.

Tableau
DATEDIFF([1], [Start Date], [End Date])
Drag options to blanks, or click blank then click option'
A'weeks'
B'week'
Cweek
Dweeks
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting quotes around the interval.
Using plural form 'weeks' which is invalid.
4fill in blank
hard

Fill both blanks to calculate the date 10 days before the Ship Date.

Tableau
DATEADD([1], [2], [Ship Date])
Drag options to blanks, or click blank then click option'
A'day'
B-10
C10
D'month'
Attempts:
3 left
💡 Hint
Common Mistakes
Using positive number which adds days instead of subtracting.
Using wrong interval like 'month' instead of 'day'.
5fill in blank
hard

Fill all three blanks to calculate the number of months between Order Date and Ship Date, then add 2 months to the Order Date.

Tableau
DATEDIFF([1], [Order Date], [Ship Date]) + DATEADD([2], [3], [Order Date])
Drag options to blanks, or click blank then click option'
A'month'
B'day'
C2
D-2
Attempts:
3 left
💡 Hint
Common Mistakes
Using different intervals for DATEDIFF and DATEADD.
Using negative number to add months.
Mixing up the order of dates in DATEDIFF.