Alteryx Designer Desktop Discussions

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

Date time Difference from a range of times

krishnagandhi
8 - Asteroid

Hi,

Having a difficult time working this, what i am trying to do is whenever there are a range of workdates i want to take the first date/time and last date/time and find the time elapsed between the two. So with the data below i basically want it to for each workdate give me the time elapsed between the first and last value. Is there an easy way to do this?

MSTdateTimeFormatWorkDate
8/26/2019 6:398/26/2019
8/26/2019 10:348/26/2019
8/26/2019 16:188/26/2019
8/27/2019 6:228/27/2019
8/27/2019 15:138/27/2019
8/27/2019 16:118/27/2019
2 REPLIES 2
jdunkerley79
ACE Emeritus
ACE Emeritus

You can use a summarise tool to get the min and max date/time for each Workdate

 

Then you can use a formula tool to compute the difference in which ever unit you wish.

 

A quick sample is attached.

 

Hopefully enough to get you started

grossal
15 - Aurora
15 - Aurora

Hi @krishnagandhi,

 

yes there its! You could use the Summarize Tool and a Formula Tool to achieve this and here is how:

 

grossal_0-1588799433094.png

 

What happens:

- First we convert the Date to actual DateTime and Date data type using two DateTime-Tools

- Select to remove the original column

- Summarize to Group by Date and get First and last of every Date

 

grossal_1-1588799490895.png

 

- Formula Tool in the end to calculate the difference:

grossal_2-1588799513649.png

 

You'll probably choose something else, but I went with seconds 😉

 

 

Workflow is attached. Let me know if this works for you 😃

 

 

Best

Alex

Labels