How to Combine Date and Time Fields into a Single DateTime Field in Tableau (MAKEDATETIME)

By: Eric Parker

Pro Headshot.jpg

Eric Parker lives in Seattle and has been teaching Tableau and Alteryx since 2014. He's helped thousands of students solve their most pressing problems. If you have a question, feel free to reach out to him directly via email. You can also sign up for a Tableau Office Hour to work with him directly!

This might be a record short post for the OneNumber blog! I hope I can save you the five minutes I wasted writing custom string calculations trying to combine Date and Time fields in Tableau.

Imagine you have a dataset which has both a Date column and a separate Time column.

 
173-1.png
 

What you’ll notice when you bring this data into Tableau is that it brings all the time values in but since they are unattached to a date value, they are set to 12/30/1899 as the date.

173-2.png

To convert this data into a unified DateTime field, all you need to do is use the MAKEDATETIME function.

 
173-3.png
 

Now you’ll have a calculated field that you can use accurately all the way down to the hour, minute or second level.

173-4.png

 

Looking for help with your own Tableau project? Book a Tableau Office Hour!

How to Build a Waterfall Chart in Tableau

How To Unpivot (Transpose) in Tableau Prep - Using the New Rank Feature

0