Jump to content

Recommended Posts

  • Administrators
Posted (edited)
Emilio Conde
This post was recognized by Emilio Conde!

Teddy was awarded the badge 'Superstar'

FAQ: How do I create a condition for operational shifts if they alternate days and hours? e.g. (The EOWeO schedule)

The following solution will keep the start times the same regardless of daylight savings.  So, there will be an 11-hour shift in March and a 13-hour shift in November. For areas that don’t follow daylight savings a simpler solution can be found further below.

Overview: To achieve the results described above the shift() function will need to be used in order to create the desired effects around daylight savings.  If there was no daylight savings the periods() function would provide a  simpler solution. 

Step 1. Create a condition for all night and day shifts. This can be done with the periodic condition tool. Note: This step will set the shift change over times, so it is important to ensure they are correct. e.g. (6:00 am and 6:00 pm et).  See screenshots below for details of how to create the day and night conditions.

Day setup:

image.png

Night setup:

image.png

Results of step 1.

image.png

Note: This can also be done with 8-hour shifts as well by using 3 conditions instead of 2

Step 2.  Create a condition with short capsules that contains the pattern of the shift schedule.  This condition will be used to select the correct shifts from the conditions made in step 1. Only one of these conditions will need to be defined since the shift schedule for EOWeO follows a 24-day pattern and each shift group is off set 7 days from the last. This condition was created with the formula tool with some help from excel. The following was a table set up in excel that was copied into the formula tool.

image.png

Note: The number format in columns B and D should be set to text to avoid problems.

The numbers in column C are the offset from the start of the 28-day cycle to that particular shift. Altering these numbers would allow you to have different schedules other than EOWeO.  It should be noted that more rows can be added by just dragging down the auto-fill in excel and setting the offset time in column C.  See the code snippet below for all of the formula details and the result of pasting from excel.
 

//-----inputs-----

$TimeAdj=3.5d //This allows the alignment of shifts depending 
              //on the start date

//-----Calculations-------

//Note: The syntax below was set up with excel and copied in
$s1    =periods(1sec,28d).move(0h)
$s2    =periods(1sec,28d).move(24h)
$s3    =periods(1sec,28d).move(108h)
$s4    =periods(1sec,28d).move(132h)
$s5    =periods(1sec,28d).move(156h)
$s6    =periods(1sec,28d).move(216h)
$s7    =periods(1sec,28d).move(240h)
$s8    =periods(1sec,28d).move(348h)
$s9    =periods(1sec,28d).move(372h)
$s10    =periods(1sec,28d).move(432h)
$s11    =periods(1sec,28d).move(456h)
$s12    =periods(1sec,28d).move(480h)
$s13    =periods(1sec,28d).move(564h)
$s14    =periods(1sec,28d).move(588h)

// Now that all 14 of the shifts have been set for their 28day 
// cycle and they need to be combined now

combinewith($s1,$s2,$s3,$s4,$s5,$s6,$s7,$s8,$s9,$s10,$s11,$s12,$s13,$s14).move($TimeAdj)

As seen in Seeq:
image.png

 

Step 3.  Combine the Night and Day conditions with the composite condition tool to make one condition for all of the shifts. See screenshot below for details.

image.png 

Step 4.  Use the condition created in step 2 to select the appropriate capsules of the combined day and night condition.  This can be done with the composite condition tool.  This will be shift #1.  

Note: The $TimeAdj variable in the long formula used to create the shift pattern may need to be adjusted to ensure correct alignment.

image.png 

Step 5.  Create the other shifts' selection conditions by using the move() function in the formula tool to move the condition created in step 2 for all the other shifts. In this case the condition will be moved three times by 7, 14, and 21 days to get the other three shift selection conditions.

Formula for 7 days:

image.png

Formula for 14 days:

image.png

Formula for 21 days:

image.png

Step 6.  Repeat step 4 for the rest of the shifts. Note there will be no need to adjust the timeAdj variable this time.

image.png

Final result:

image.png

 

Edited by Teddy
  • Like 1
  • Thanks 1
  • Administrators
Posted

To create the same shift schedule without daylight savings or excluding the effect of daylight savings the following steps can be used.

Step 1. Use the periods() function to create the 28 day cycle.  This time 12 hour capsules will be used since there is no need to use the shift() function to deal with daylight savings.  This will be the condition used to create all four shifts.  The same excel trick that was used above can be used here as well. See the formula syntax below for details.  

//-----inputs-----
$TimeAdj=12h   //This allows the alignment of shifts depending 
               //on the start date

//-----Calculations-------

//Note: The syntax below was set up with excel and copied in
$s1    =periods(12h,28d,'2018-01-01', 'GMT').move(0h)
$s2    =periods(12h,28d,'2018-01-01', 'GMT').move(24h)
$s3    =periods(12h,28d,'2018-01-01', 'GMT').move(108h)
$s4    =periods(12h,28d,'2018-01-01', 'GMT').move(132h)
$s5    =periods(12h,28d,'2018-01-01', 'GMT').move(156h)
$s6    =periods(12h,28d,'2018-01-01', 'GMT').move(216h)
$s7    =periods(12h,28d,'2018-01-01', 'GMT').move(240h)
$s8    =periods(12h,28d,'2018-01-01', 'GMT').move(348h)
$s9    =periods(12h,28d,'2018-01-01', 'GMT').move(372h)
$s10    =periods(12h,28d,'2018-01-01', 'GMT').move(432h)
$s11    =periods(12h,28d,'2018-01-01', 'GMT').move(456h)
$s12    =periods(12h,28d,'2018-01-01', 'GMT').move(480h)
$s13    =periods(12h,28d,'2018-01-01', 'GMT').move(564h)
$s14    =periods(12h,28d,'2018-01-01', 'GMT').move(588h)

// Now that all 14 of the shifts have been set for their 28day 
// cylce they need to be combined

combinewith($s1,$s2,$s3,$s4,$s5,$s6,$s7,$s8,$s9,$s10,$s11,$s12,$s13,$s14).move($TimeAdj)

Note: The time zone specification ensures that you will exclude daylight savings.

Formula as seen in Seeq:

image.png

Step 2. Use the move() function to align all of the shifts correctly.  See screen shots below for details.

Shift #1 No offset:

image.png

Shift #2 21 day offset:

image.png

Shift #3 14 day offset:

image.png

Shift #4 7 day offset:

image.png

Final result:

image.png

  • Like 1
  • 4 years later...
Posted

Great Post! Was able to make some modifications for a Dupont Schedule. You just need to use the following code for the Starting Shift schedule. 


$s1    =periods(1sec,28d).move(0h)
$s2    =periods(1sec,28d).move(24h)
$s3    =periods(1sec,28d).move(48h)
$s4    =periods(1sec,28d).move(72h)
$s5    =periods(1sec,28d).move(180h)
$s6    =periods(1sec,28d).move(204h)
$s7    =periods(1sec,28d).move(228h)
$s8    =periods(1sec,28d).move(264h)
$s9    =periods(1sec,28d).move(288h)
$s10    =periods(1sec,28d).move(312h)
$s11    =periods(1sec,28d).move(420h)
$s12    =periods(1sec,28d).move(444h)
$s13    =periods(1sec,28d).move(468h)
$s14    =periods(1sec,28d).move(492h)

 

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...