O'Reilly logo

Tableau 10.0 Best Practices by Jenny Zhang

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Date formatting

In the previous section, we talked about how to format individual measure. In this section, we will discuss how to format date.

Time range

If you know that the duration of your time range will be always less than 24 hours, you can use the built-in format of time range. If your time range is not in seconds, you need to change it to seconds and then start formatting. It is very simple to get the time range into seconds using DATEDIFF ('second',[Order Date],[Ship Date]).

After changing the time range to seconds, you can create another calculated field as DATETIME ([Time Range (seconds)]/86400). Then set the format of this calculated field as custom hh:mm:ss (note that the lower case mm is minutes and the upper case MM is month), as shown ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required