Forum Discussion
Davykyndt
9 years agoFrequent Visitor
Creat column with shift numbers
I have a calendar table where I'd like to add a column with workingshifts. I have 2 working shifts working 7 days for shift A and then 7 days for shift B. Any idea how I can calculate this basen ...
- 9 years ago
Hi I found a solution:
Shiftnr = if((mod(calender[Date]+2;14)+1)<=7;"Shift A"; "Shift B")
parry2k
Super User
9 years agoIs there any relationship between SenShiftDay column and date column in your example?
- Davykyndt9 years agoFrequent Visitor
No, this table is created from a calendarauto() function (Date column).
- parry2k9 years ago
Super User
how di d you calcualted senshiftday in your example? What made you choose value 1 to 7
- Davykyndt9 years agoFrequent Visitor
SenShiftday = if((WEEKDAY(calender[Date];2)+3)>7;WEEKDAY(calender[Date];2)-4;WEEKDAY(calender[Date];2)+3)
The shift starts on a day 1 and runs until day 7, after this the next shift starts.