0
0
Tableaubi_tool~15 mins

Date hierarchy (year, quarter, month, day) in Tableau - Real Business Scenario

Choose your learning style9 modes available
Scenario Mode
👤 Your Role: You are a sales analyst at a retail company.
📋 Request: Your manager wants to see sales trends broken down by year, quarter, month, and day to understand seasonal patterns and daily sales fluctuations.
📊 Data: You have sales transaction data including the date of sale and the sales amount for each transaction.
🎯 Deliverable: Create a Tableau dashboard with a date hierarchy filter that allows drilling down from year to quarter, month, and day, showing total sales at each level.
Progress0 / 5 steps
Sample Data
DateSales Amount
2023-01-05150
2023-01-15200
2023-02-10180
2023-03-20220
2023-04-05300
2023-04-25250
2023-05-15270
2023-06-10320
2023-07-05400
2023-08-15350
2023-09-10380
2023-10-20420
1
Step 1: Connect Tableau to the sales data source containing Date and Sales Amount columns.
Use 'Connect to Data' and select the data file or database with the sales data.
Expected Result
Tableau shows the data fields Date and Sales Amount in the Data pane.
2
Step 2: Create a date hierarchy in Tableau using the Date field.
Right-click the Date field in the Data pane, select 'Create' > 'Hierarchy', name it 'Date Hierarchy'. Drag Date into this hierarchy. Tableau automatically creates Year, Quarter, Month, and Day levels.
Expected Result
A 'Date Hierarchy' appears in the Data pane with Year, Quarter, Month, and Day levels.
3
Step 3: Create a new worksheet to visualize total sales by date hierarchy.
Drag 'Date Hierarchy' to Rows shelf. Drag 'Sales Amount' to Columns shelf and set aggregation to SUM.
Expected Result
A bar chart appears showing total sales aggregated by Year initially.
4
Step 4: Enable drill down on the date hierarchy to explore sales by quarter, month, and day.
Click the plus (+) icon next to Year in the view to drill down to Quarter, then Month, then Day.
Expected Result
The chart updates to show sales by Quarter, then Month, then Day as you drill down.
5
Step 5: Create a dashboard and add the worksheet with the date hierarchy visualization.
In Tableau, create a new dashboard and drag the worksheet onto it. Add a filter for the Date Hierarchy to allow interactive drill down.
Expected Result
Dashboard shows the sales chart with interactive date hierarchy filter allowing users to select year, quarter, month, or day.
Final Result
Date Hierarchy Sales Dashboard

+-----------------------------+
| Year  | Total Sales          |
|-------|----------------------|
| 2023  | ████████████████████ |
+-----------------------------+

Drill down:
+-----------------------------+
| Quarter | Total Sales         |
|---------|---------------------|
| Q1      | ███████             |
| Q2      | ████████            |
| Q3      | ███████             |
| Q4      | ████                |
+-----------------------------+

Further drill down to Month and Day shows detailed sales bars.
Sales are highest in Q1 and Q2 of 2023.
Monthly sales show peaks in April and July.
Daily sales fluctuate, with some days showing significantly higher sales.
Bonus Challenge

Add a filter to the dashboard that allows users to select a specific year and see the sales breakdown by quarter, month, and day for that year only.

Show Hint
Use a 'Year' filter on the Date Hierarchy field and set it to show as a dropdown filter on the dashboard.