Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
Start Free Trial

Alteryx Designer Desktop Discussions

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

To Change to Time

mmustkee
10 - Fireball

Hi,

 

Can you please help me charging the below table to time format without changing column and output should be as result column?  Thanks in advance.

TimeResult
0.2208335:18
0.2208335:18
5.42E-021:18
5.83E-021:24
5.42E-021:18
0.256:00
5.42E-021:18
5.42E-021:18
5.42E-021:18
7.50E-021:48
5.42E-021:18
5.42E-021:18
5.42E-021:18
7.50E-021:48
5.42E-021:18
0.06251:30
5.00E-021:12
4.58E-021:06
5.42E-021:18
0.153:36
7.50E-021:48
7 REPLIES 7
Qiu
21 - Polaris
21 - Polaris

@mmustkee 
I tried with ToDateTime Function

2A.PNG

atcodedog05
22 - Nova
22 - Nova

Hi @mmustkee 

 

Here is my approach. I am using todatetime() to convert number to datetime similar to @Qiu . But instead of substring to capture a part of string i am using datetimeformat() to show only hours:mintues. 

 

atcodedog05_0-1622526980843.png

 

Hope this helps 🙂

Qiu
21 - Polaris
21 - Polaris

@atcodedog05 
This looks better. 👍

mmustkee
10 - Fireball

Hi,

 

Solution worked but what if Time column has data type as VString.

Can we do that without changing data type from he formula tool.

mmustkee
10 - Fireball

HI Qiu,

 

Thanks for the solution and it worked too. But could you please explain what does length 11,5 means. what if if we put 12,4, or 24 or any number. Could you please explain how does this substring formula works.

 

Thanks for your help as always.

atcodedog05
22 - Nova
22 - Nova

Hi @mmustkee 

 

to answer 2 of your question.

 

1. If time field is string instead of double does it work? 

Ans: No, ToDateTime(x) can take only numeric field

 

2. Why is substring set to 11,5 ?

Ans: Substring takes following arguments Substring(String,start,length) . Here [Time] is the column, 11 is start position and 5 is the  length. So it takes 5 chars from 11th position.

 

Hope this helps 🙂

Qiu
21 - Polaris
21 - Polaris

@mmustkee 
Thank you for the answer. 😁

Labels
Top Solution Authors