Give a chestnut! Tableau Tips (102): Teach you to make a New Year's calendar

published: 2021-06-05

In this issue of "Give a Chestnut", Ada will share with you Tableau skills: teach you to make a New Year's calendar.

To facilitate learning, we use a simple Excel data: calendar data for the whole year of 2019

 

Specific steps are as follows:

Step 1:Connect to the data source

Click New Data Source under the Data menu bar, select More, click Date Data.csv in the pop-up file option box, and click Open.

Step 2:Create a head worksheet

Create a new worksheet and name it Header.

Right-click on the date and select Create calculated field. Here, create a calculated field year to extract the year in the date:

DATE(DATEPARSE ("yyyy", STR(YEAR([DATE])) ))

Then, change the data type of the calculated field year you just created to date.

Then, drag the year dimension into the text marker.

Click the text in the mark card, and select the alignment method to center in the middle.

Then, set the text format (as shown below):

Right-click the text to mark the year, and set the default value in the shaded format to none:

Step 3:Create a monthly worksheet

Create a new worksheet and name it month.

Next, create the calculated field month %3 and drag the calculated field month %3 to the dimension.

MONTH([Date])%3

Drag the calculated field month %3 in the dimension to the column. Then, right-click the month %3 and click Sort, select manual sort, and place 0 at the bottom.

Drag the date dimension to the row, right-click the date capsule, and select Discrete, Quarter.

Drag the date dimension into the text marker box, right-click to select the format: discrete, month. Right-click the month (date), and set the date format in the area format to a number.

Then, click the shadow to drop down to the row grading, and set the area format to none.

Finally, edit the font and size of the label, the adjusted effect is as follows:

Step 4:Create a calendar sheet

Create a new worksheet and name it Calendar.

Create a new calculated field week index, and drag the calculated field week index to the dimension.

DATEPART(‘week’,[DATE])

——

{FIXED MONTH([DATE]):MIN(DATEPART(‘week’,[DATE]))}

New calculated field days:

IIF(ISNULL([Date (Holiday)]),DATENAME(‘day’,[Date]),[Holiday])

Drag the calculated field month%3 to the column and set the sorting to manual, placing 0 at the bottom (the method is the same as above).

Drag the date into the column, select discrete, working day.

Drag the date to the row, select discrete, quarterly.

Drag the calculated field week index to the row.

Drag the calculated field day to the label in the mark.

Drag the date to the color of the marker and set it to consecutive days. Change the mark from automatic to square. Click the color box to set the opacity to 80%.

Right-click the weekday (date), set the format, change the date format in the default value to the first letter, and set the font to white. As shown below:

Then, adjust the overall format (as shown below):

Step 5:Create a day range worksheet

Create a new worksheet and name it the day range.

Drag the date to the column and select the attribute as continuous and day.

Drag the date to the color and select the attribute as continuous and day.

Set the marker as a bar graph.

Right-click to edit the axis, and the range selection is fixed: January 1, 2019-December 31, 2019.

Then, adjust the format (as shown below):

Step 6:Create a calendar board dashboard

Create a new dashboard and name it Calendar.

Drag the horizontal part of the object to the panel and set it to a fixed size of 712*712.

Drag another vertical object to the panel, drag the day range of the worksheet into it, set the margin to 0 in the right layout; right-click the day range in the panel, remove the title display, check the fixed height and edit the height as 59. Finally choose to fit the entire view.

Drag the month of the worksheet to the bottom and right-click to hide the title.

After changing the layout mode to Floating, drag the worksheet calendar to the panel, right-click to hide the title, and set the background color to black (transparency 70%) in the right layout. The coordinate position is as shown in the figure below:

Drag the head of the worksheet to the panel, hide the title, and select the middle position of the upper row to place it.

In this way, we have completed the production of the 2019 calendar!

Today’s Tableau tips, have you got it yet? Give it a try!