KNOWLEDGE BASE

Truncate Date to Quarter Hour


Published: 28 Feb 2019
Last Modified Date: 22 Mar 2019

Question

How to truncate a date to the quarter-hour.

Environment

  • Tableau Desktop

Answer

See the attached workbook. If [!Order DateTime] is the date-time field that should be truncated, the following calculation can be used:

DATEADD('minute',
    int(DATEPART('minute',[!Order DateTime])/15)*15,
    datetrunc('hour',[!Order DateTime]))

Additional Information

There is no built in 'quarter-hour' option for DATETRUNC(). 


Discuss this article... Feedback Forum
Did this article resolve the issue?