Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

yBeginner Question -> Date time trim and difference

RKGV
7 - Meteor

 

Hi Experts,

 

I am a beginner need your help..

 

I have date and time in a column. I want date and time in 2 columns ( i did it) and I want to find time difference of previous row per day.. Like the output as below. kindly support.

 

Column 1

 

2021-02-07 00:29:43
2021-02-07 01:29:26
2021-02-07 02:29:25
2021-02-07 03:43:24
2021-02-07 04:39:49
2021-02-07 05:57:16

2021-02-08 01:29:26
2021-02-08 02:29:25

 

Output

 

DateTimeDifference
2021-02-0701:29:2600:00:00
2021-02-0702:29:2500:59:59
2021-02-0703:43:2401:13:59
2021-02-0704:39:4900:56:25
2021-02-0705:57:1601:17:27
2021-02-0801:29:2600:00:00
2021-02-0802:29:2500:59:59
9 REPLIES 9
atcodedog05
22 - Nova
22 - Nova

Hi @RKGV 

 

Here is how you can do it.

Workflow:

atcodedog05_1-1629873790202.png

 

 

1. Using formula tool to bring date to desired format.

2. Using multi-row formula to calculate time diff (seconds) of current row and prev row.

3. Using formula tool convert seconds into time format.

4. Using select tool to keep only required columns.

 

Hope this helps : )

Sebastiaandb
12 - Quasar

@atcodedog05 Was faster, of course ;-), always is haha

Sebastiaandb
12 - Quasar

and the solution i had.. haha

atcodedog05
22 - Nova
22 - Nova

Hi @Sebastiaandb 

 

I like how you managed to arrive at time thats nice method 😀👍. I will take it for reference 🙂.

binay2448
11 - Bolide

One more solution.....

RKGV
7 - Meteor

Thanks all 🙂 

atcodedog05
22 - Nova
22 - Nova

Happy to help : ) @RKGV 

Cheers and have a nice day!

RKGV
7 - Meteor

How did it trim only the date ? without datatimeformat ?

RKGV_0-1629895928042.png

 

atcodedog05
22 - Nova
22 - Nova

Hi @RKGV 

 

Because datatype is set to date hence only taking date🙂

 

atcodedog05_0-1629896068970.png

 

Hope this helps : )

 

Labels