Tableau is a self-service, highly recommended Business Intelligence, Data Analytics, and Visualization tool. It stands as a leader for nine times consecutively in Gartner’s Magic Quadrant for BI and data analytics. In this tutorial, we learn some essential/useful Tableau Date Functions to manipulate date values in Tableau Dashboards.
What is Tableau Date Functions
The date functions are used to work with the data records in a Tableau Data Source. Date functions in Tableau are useful for various arithmetic and logical operations. To carry out these functions successfully it is necessary to know all the Date related functions in Tableau along with their working.
Date Functions in Tableau
The following are the Date functions in tableau:
Syntax – DAY(Date)
If you want to know the day, then this function is used.
Syntax – MONTH(Date)
If you want to know the month from the date given to Tableau, then this function is used.
Syntax – YEAR(Date)
If you want to know the year of the date given to Tableau, then this function is used.
Syntax – DATEDIFF (depart, date1, date2, [start of the week(optional)])
If you want to know the difference between the input dates in Tableau, then this function is used.
Syntax – DATEPART (depart, date, [start of the week(optional)])
This syntax is helpful if you want to get the integer part of the date.
Syntax – Depart (depart, interval, date)
If you want to add a specific date to the existing date added to Tableau initially, the DATEADD function is used.
Syntax – DATETRUNC (depart, Date, [start of the week(optional)])
If you need to truncate the date or shorten or minus the date pre-provided to Tableau, the DATETRUNC function is used. It gives a new date as an output.
Syntax – DATENAME (depart, date, [start of the week(optional)])
If you need to know the date provided as an input to Tableau this function is used. It gives the output date in the form of string.
9. MAKE DATE
Syntax – MAKE DATE (Year, Month, Day)
This function is used to create a visualization of the date when you input the required year, month and date.
10. MAKE TIME
Syntax – MAKE TIME (Hour, Minute, Second)
This function provides the resultant date value with the help of provided hours, minutes and seconds.
Syntax – NOW ()
If you want to know the present date and time provided to the Tableau, then this function will be used.
Syntax – Today ()
When you use this function, you will get the current date as an output.
Syntax – (MAX (date1, date2))
This function is basically used for a comparison of numeric expressions. If you want to compare dates, this function is valid for dates as well. It returns the date value after comparing it. If the value after returning comes out as null value, it is granted for this function.
Syntax – (MIN (date1, date 2))
This function is basically used for a comparison of numeric expressions. If you want to compare dates, this function is valid for dates as well. It returns the minimum date values after comparing. If the value after returning comes out as null value, it is granted for this function.
Syntax – YEAR (date)
This function gives the output as a year of the date and it is associated as a whole number.
Syntax – TODAY ()
If you want to know the present date, this function is used.
Conclusions – Tableau Date Function
In this blog, we discussed all the date functions used by Tableau. The date functions in Tableau are used for different functions associated with the date and time provided to Tableau. Some of the functions are valid for arithmetic functions as well as date functions and works according to the input provided in the syntax. If you want to learn to use these Tableau Date Functions then Join Our Latest Tableau Online Course & Become pro in Tableau.