Date Calculated Fields
Date logic in Tableau Desktop allows for the conversion of date fields into specific date parts. The current date and time can be returned by creating a calculated field. There is also logic for the manipulation of existing dates, such as adding or subtracting periods of time from a given date.
Returning to the order example data source from the introduction, date functions could be used to parse out the order year as a specific column from the order date and the number of days between when an order is placed and shipped could be calculated.
Date Parts
Many date functions in Tableau allow users to take date fields and return a specific date part from them.
The DATEPART
function takes a string input, used to specify the relevant date part, and a date input from which to calculate the date part. The string input must be a date part name, all in lowercase (e.g., year
, quarter
, month
, week
, or day
). The function returns the specified date part for the...