Search

Search Scripts

Scripting Reference Guides

Rick W

Tableau Date and Time Functions

Date and Time Functions within Tableau.


A. YEAR:


DATEPART('year', [OrderDate])
 

This example extracts the year from the OrderDate column in the Sales table, providing the year value for each order.

B. MONTH:


DATEPART('month', [OrderDate])

This example extracts the month from the OrderDate column in the Sales table, providing the month value for each order.

C. DAY:


DATEPART('day', [OrderDate])
 

This example extracts the day from the OrderDate column in the Sales table, providing the day value for each order.

D. DATE:


MAKEDATE(2023, 6, 30)
 

This example creates a date using the specified year (2023), month (6), and day (30) values, resulting in the date "June 30, 2023".

E. TODAY:


TODAY()
 

This example returns the current date as of when the calculation is performed. It provides the current date dynamically.

Previous Article Tableau BI Scripting for Logical Functions
Next Article Tableau SQL Mathematical Functions
Print
217