Show Seconds as hh:mm:ss

Version 4



    If you've ever wanted to show a large number of seconds as hours, minutes, and seconds then you can follow the KB article here (Converting Seconds to HH:MM:SS or DD:HH:MM:SS | Tableau Software) to create a string.  But, if the total time is less than 1 day and you want to keep it numeric (lots of benefits: performance, continuous values, etc...) then consider the following calculation.



    Seconds as Fraction of a day:


    //Converts number of seconds to fraction of a day

    [Seconds] / 86400




    Then just apply the hh:mm:ss as custom formatting to your calculated field:


    hh:mm:ss - will format it with hours, minutes, and seconds

    nn:ss - will format it with minutes and seconds.




    This is not mine originally. I picked it up somewhere along the way...


    Note: If your total number of seconds is above 86400, then Tableau will 'reset the clock' and start counting the seconds from 0. So 86401 seconds shows up as 00:00:01 and not 24:00:01.


    [Edited 20140107 - added note on duration > 86400 and updated the attachment]