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

Time difference

Feras95p
8 - Asteroid

Dear all,

 

 

I want to calculate the time difference  between two columns for example 

like what's the time difference between the start and K complete the output in one column and the time difference between the K complete and E complete in one column.

 

 

Any help in that?

o.PNG

 

 

 

 

8 REPLIES 8
MarqueeCrew
20 - Arcturus
20 - Arcturus

@Feras95p ,

 

using a datetime tool or a formula, you'll want to convert these strings into real datetime formats. 

then you can use a datetimediff() formula and convert the answer to minutes or hours. 

cheers,

 

 mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
Qiu
21 - Polaris
21 - Polaris

@Feras95p 
This can be done relatively easy by DateTimeDiff. Dont what unit you want for the unit, difference in Seconds is given in the sample flow.1019-Feras95p.PNG

Feras95p
8 - Asteroid

Hi @Qiu ,

 

 

Thanks for helping, I want in Hours:minutes

MarqueeCrew
20 - Arcturus
20 - Arcturus

Hint:

 

mod(121,60) = 1

 

tostring((121-mod(121,60))/60)+":"+
Padleft(tostring(mod(121,60)),2,"0")

 

that should get you 2:01

 

 cheers,

 

 mark

 

 from my iPhone

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
Qiu
21 - Polaris
21 - Polaris

@Feras95p 
Is this one looking better?1019-Feras95p-1.PNG

Feras95p
8 - Asteroid

Hi @Qiu,

 

 

Thanks a lot ! 

 

One more question why in the output the last column K-E the first row 1:6 and it should be 1:06 because some of them will be 1:3 so I will not know if it's 1:30 or 1:03. Is there a way to solve this problem?

Qiu
21 - Polaris
21 - Polaris

@Feras95p 
A PadLeft function would do the trick. Check below and mark it accepted if you like it.1019-Feras95p-2.PNG

Qiu
21 - Polaris
21 - Polaris

@Feras95p 
THank you for the mark. Appreciate.

Labels
Top Solution Authors