Tableau Date Functions

by Bridget Ama Boateng

Why do we need to use date functions ?

  • allows you to manipulate the dates within your data.

Let's look at 'DATEADD' :allows you to add an interval to the given date.

DATEADD

In this example the month will be increase by 3, as that is the number place on the interval section of the function

'DATEDIFF': returns the difference between two dates so the start date is subtracted from the end date.

By dragging this calculated field into the 'Label' it will create a new column showing the difference between the order date and the ship date.

DATEDIFF EXAMPLE

'DATETRUNC': used to truncate the date specified in the formula.

DATETRUNC
DATETRUNC EX

As 'month' has been selected, all the dates in Order date of January will be truncated to January and all the order dates in February will be truncated to February and so on.  

Avatar

Bridget Ama Boateng

Fri 08 Mar 2024

Thu 27 Oct 2022

Wed 26 Oct 2022