Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Convert Number (Double) to Time Format

Patricia2
7 - Meteor

Hi all,

 

I have a column that contains whole numbers where there should be time. The number I have is the amunt of hours. For example I have 91.97 where it should be 91:59:00, 90.14 where it should be 90:08:00. I tried the time formatting tools and they didn't work. Do you know how I can do that change?

 

Thanks!

3 REPLIES 3
grossal
15 - Aurora
15 - Aurora

Hi @Patricia2,

 

We could use a Formula to do the trick, but your precision isn't good enough.

 

.96 * 60 = 58.2 (Goal: 59)

.14 * 60 = 8.4   (Goal 😎

 

We could round, but no matter if we always round up or down, we won't get both to work. How should we handle it?

 

Best

Alex

Patricia2
7 - Meteor

Well the actual number contains more decimals than the example I gave. The number actually is

91.97833


and I want it to be 

 

91:58:42

 

When I apply those operators it multiplies also the number of decimals so I can't get a number with just hours, minutes (2 digits) and seconds (2 digits). is there a tool to remove the remaining decimals?

 

thanks

grossal
15 - Aurora
15 - Aurora

I read your last part a bit to late and already got a way without rounding or using Fixed Decimal.

 

grossal_1-1588275780434.png

 

Let me note this: The datatype "time" won't work because the data type is only made for day "times" (up to 24h - or at least that's what I am aware off).

 

Workflow attached. Let me know what you think.

 

Best

Alex

Labels