2 Replies Latest reply on Dec 7, 2018 9:44 AM by Don Wise

# How to convert number to hh:mm format

Hi , I am having a number 14567 coming from the database . it is actually number of minutes .

Could you please let me know if we can convert that number to hh:mm format in tableau.

Thanks in advance.

• ###### 1. Re: How to convert number to hh:mm format

I think this

• ###### 2. Re: How to convert number to hh:mm format

Hello,

That number of minutes is equivalent to: 14567 min = 10 days 02:47:00, which is more than what standard Tableau formatting in hh:mm format can do natively.

You can likely find your answer here:  Formatting Time Durations in Tableau | Drawing with Numbers Be sure to read the entire blog post by Jonathan Drummey, but you're likely looking at a calc similar to this that he's posted there:

//replace [Seconds] with whatever field has the number of seconds in it

//and use a custom number format of 00:00:00:00 (drop the first 0 to get rid of leading 0's for days)

IIF([Seconds] % 60 == 60,0,[Seconds] % 60)// seconds

+ IIF(INT([Seconds]/60) %60 == 60, 0, INT([Seconds]/60) %60) * 100 //minutes

+ IIF(INT([Seconds]/3600) % 24 == 0, 0, INT([Seconds]/3600) % 24) * 10000 //hours

+ INT([Seconds]/86400) * 1000000 // days

Thx, Don