I'm having some trouble configuring the schedules function on the gate to capture the required shift patterns.
Shift = A (2 Days of day shift 7:00am to 7:00 pm followed immediately by 2 days of nights 7:00pm to 7:00 am)
Shift = B (2 Days of day shift 7:00am to 7:00 pm followed immediately by 2 days of nights 7:00pm to 7:00 am)
Shift = C (2 Days of day shift 7:00am to 7:00 pm followed immediately by 2 days of nights 7:00pm to 7:00 am)
Shift = D (2 Days of day shift 7:00am to 7:00 pm followed immediately by 2 days of nights 7:00pm to 7:00 am)
Looking at the above rota when starting on the 2nd of January shift D are on day the 2nd and 3rd and than on nights the 4th and 5th into the morning of the 6th and so on for all the shifts.
I have tried to set up shifts in a number of ways. First I created just a shift A,B,C,D each configured to the relevant dates but this quickly seems to go out of sequence.
I than attempted to create a day and night shift for each group e.g. Shift_A_days , Shift_A_Nights with the intention to create a composite shift based on days and nights but I am having a similar issue were in multiple shifts seem to be active at once. It seems to be following the calendar week repeating on the same days of each week rather than being offset as the weeks move on.
Looking at the coloured rota above if a shift was split into days and nights
• On days they would be on for 2 days and then off for 6 e.g. start days on the 6th of January finish on the 7th and then next on days on the 14th January
• On nights they would be 3 days on and then 4 days off e.g starting nights on the 8th of January and finishing nights the morning of 10th of January next returning to nights on the 16th of January
I am assuming I'm missing something obvious here and would greatly appreciate any help
When you have complex patterns, you generally need a complex solution. See this topic for working code that implements a generic solution for any repeating shift schedule:
If you aren't using PostgreSQL, you will have to substitute other ways to use table-returning functions. (Good luck with that.)
Looking at your schedule setup, you don't actually repeat week 1 until week 9. Based on this, you likely need to create basic schedules for Shift A Week 1, Week 2 ... 9, then a composite schedule that grabs all 9 schedules for Shift A.
Each schedule would be setup to repeat "Weekly", with 1 week on, 8 weeks off. Pretty complicated.
Yup. Unless there's a solution in hand that can take the 8-week pattern and replicate it for you on demand.
But in this case, the repeat is 8 days. Two days on, six days off. The schedule should select "all days", not any particular weekdays. And uncheck "observe holidays".
Basic mistake realized i hope. Thank you very much for the quick replies.
Blockquote But in this case, the repeat is 8 days. Two days on, six days off. The schedule should select "all days", not any particular weekdays. And uncheck "observe holidays".
I was assuming that system would shift the days as the weeks moved forward instead of considering that all days should be selected and use the repeating function would
to shift the days.
At least for the day shift this seems to have resolved the issue as i have selected the options pturmel suggested and the schedule "active now" indicator at least looks correct for today.
I have updated the night shift with shift time 19:00 - 07:00 which I'm not sure will work correctly but if not i can create a couple a night shift - morning - night shift pattern and make a composite from that.
failing that I will try a variant of your table option pturmel , we are using MySQL
Thanks for the help so far ,
EDIT :
As a test of the idea I have created 4 shifts c1 to c4
c1 = 19:00 -24:00 starting 13/01/23
c2 = 00:00 -07:00 starting 14/01/23
c3 = 19:00 -24:00 starting 14/01/23
c4 = 00:00 -07:00 starting 15/01/23
Than combined these to make a pair of composite single shift across a night and day, than from there make a composite shift
Comp1 =
c1 = 19:00 -24:00 starting 13/01/23
c2 = 00:00 -07:00 starting 14/01/23
Apologies late getting back to this. The issue as I mentioned above was with misunderstanding "all days" setting. Once "all days" setting was enabled (rather than a specific day aligning to start date) it was not difficult to configure. Days are a simple repeating 07:00-19:00 , 2 days on 6 off .Nights are a composite of evenings(19:00 -24:00 2 days on 6 off) and mornings(00:00 - 07:00 2 days on 6 off) and the shift becomes a composite of days and nights.