Alteryx Designer Desktop Discussions

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

Subtracting time value from previous row and based on a condition capture the time value

bperiasw
5 - Atom

I have a requirement to compute from below table to arrive timeslots for each door group ID like

1) 0:00 ~ 1:00 (after adding :30 to the last value)

2) 17:00 ~ 00:00.

 

Basically if the timesegment row value differences are more than 30 mins then those are separate slots having a different shift start time and all slots in the below table are 30 mins slots. Any pointers to this will be helpful.

 

doorgroupidweekdaytimesegmentactive
1010:00T
1010:30T
10117:00T
10117:30T
10118:00T
10118:30T
10119:00T
10119:30T
10120:00T
10120:30T
10121:00T
10121:30T
10122:00T
10122:30T
10123:00T
10123:30T
4 REPLIES 4
apathetichell
18 - Pollux

Hi!

 

Could you show me an example of the output you'd like? Its fairly straight forward to divide times up by group - but I'm not quite sure what you want as the final output. If you want to just segment into 1) and 2) - you could use a formula like:

if [timesegment]<"17:00" then 1 else 2 endif

 

 

bperiasw
5 - Atom

I would like to have a new column Shift start time and end time.

 

bperiasw_0-1623088083632.png

 

OllieClarke
15 - Aurora
15 - Aurora

Hey @bperiasw 

Here's a workflow which does what you want (I think). One thing I should say is that ideally there would be a date element to your time segment, otherwise shifts which run from pre-midnight to post will be hard to deal with. 

 

I've kept the Shift ID in the output, but you could drop it in the join tool if you want

 

Hope that helps,

 

Ollie

OllieClarke_0-1623156645988.png

 

bperiasw
5 - Atom

Thanks this works perfect.

 

Labels