Tableau practice: Dates, durations and business calendars

Chapter 8 · 5 questions · included in full access

  1. Question 1 · easy

    Order quarter label

    Create Order Quarter: format the quarter of the Order Date as 'Q' + STR(QUARTER([Order Date])).

    Solve it in your browser
  2. Question 2 · easy

    Fulfillment duration

    Create Days to Ship: compute the elapsed days between Order Date and Ship Date: DATEDIFF('day', [Order Date], [Ship Date]).

    Solve it in your browser
  3. Question 3 · easy

    DATEDIFF parameter order

    What happens if you accidentally reverse the dates in DATEDIFF('day', [Ship Date], [Order Date]) when shipments happen after orders?

    Solve it in your browser
  4. Question 4 · medium

    Weekend order flag

    Create Is Weekend: return True if the Order Date falls on Sunday (1) or Saturday (7) using DATEPART.

    Solve it in your browser
  5. Question 5 · medium

    Truncated month date

    Create Month Start: truncate the Order Date down to the first day of the month using DATETRUNC('month', [Order Date]).

    Solve it in your browser

These questions are part of full access.

The first chapters of every track are free. Full access is a one-time payment.

See pricing