English 中文(简体)
Tableau Tutorial

Tableau Data Sources

Tableau Worksheets

Tableau Calculations

Tableau Sort & Filters

Tableau Charts

Tableau Advanced

Tableau Useful Resources

Selected Reading

Tableau - Date Calculations
  • 时间:2024-11-03

Tableau - Date Calculations


Previous Page Next Page  

Dates are one of the key fields which is extensively used in most of the data analysis scenarios. Hence, Tableau provides a large number of inbuilt functions involving dates. You can carry out simple date manipulations such as adding or subtracting days from a date. You can also create complex expressions involving dates.

Following are the steps to create a calculation field and use date functions in it.

Create Calculated Field

While connected to Sample superstore, go to the Analysis menu and cpck ‘Create Calculated Field’, as shown in the following screenshot.

Create calculation

Calculation Editor

The above step opens a calculation editor, which psts all the functions available in Tableau. You can change the dropdown value and see only the functions related to Date.

date calc 1

Create a Formula

Now, find out the sales volume along with the difference in the date of sales in months from 21st March 2009. For this, create the formula as shown in the following screenshot.

date calc 2

Using the Calculated Field

Now to see the created field in action, you can drag it to the Rows shelf and drag the Sales field to the Columns shelf. Also drag the ship Date with months. The following screenshot shows the Sales values.

date calc 3 Advertisements