Tableau :Create custom dates and a date hierarchy | Fundamentals
Please download the dataset
You're preparing a view for your team to help them analyze sales. They generally do this analysis by looking at the discrete date parts of years and quarters and do not need to drill down beyond that level of detail. Your goal is to create two custom discrete date parts of Year and Quarter for the Order Date field, assemble them into a hierarchy, and create a view with it.
Good luck!
Use the Order Date field to create a discrete quarters custom date field, and use the custom date field to show the sum of Sales in a bar chart.
In the Data pane, point to Order Date, click the down-arrow, point to Create, and click Custom date.
Name the custom date field Order Date (Discrete Quarters).
Set Detail to Quarters.
Select Date Part and click OK.
Drag Sales to Rows and Order Date (Discrete Quarters) to Columns.
In the Marks card, change the mark type to Bar.
Use the Order Date field to create a discrete years custom date field.
In the Data pane, point to Order Date, click the down-arrow, point to Create, and click Custom date.
Name the custom date field Order Date (Discrete Years).
Set Detail to Years.
Select Date Part and click OK.
Create a hierarchy with the custom date fields, in the view replace Order Date (Discrete Quarters) with the hierarchy, and expand the hierarchy.
In the Data pane, drag Order Date (Discrete Quarters) on top of Order Date (Discrete Years).
Name the hierarchy Order Date (Discrete Years to Quarters).
Click OK.
Drag Order Date (Discrete Years to Quarters) to Columns, and release it on Order Date (Discrete Quarters), to replace it.
Expand the hierarchy to show both years and quarters.
Comments
Post a Comment