Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    gint32 is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jan 2015
    Location
    Australia
    Posts
    116

    annual leave

    Hi Everyone,
    I am revisiting this once again some 5yrs years later, I basically need help or advice with the following staffing issue in connection with allocation of A/L. Presently all Staff are assigned annual Leave letter representing a 6 wks slot per year, these 6 week blocks are represented by alpha letters from A,B,C,D,E,F,H. These letters correspond to 6 wk blocks within each calendar year, this allocated leave letter remains with you throughout your employment. For obvious reasons this doesn’t suit every member of staff, so our admin Dep’t allow staff to swap with another staff member willing to trade, so basically if we could find another staff member willing to swap the leave letter then Admin will allow us to do the swap, on a one time only basis per year, meaning once you’ve swapped then you cannot later on then change your mind and request to swap the swap. So how staff reach out to achieve this presently is to send out an e-mail to all staff requesting what letter you have and what letter (period) you want, this is a fairly large company with over 400 staff.

    This system doesn’t works really well, because if a person sends out an Email request to swap, they will only get a response(via Email) if someone has what you want, which is usually not the case, also if something crops up its really difficult to keep track of all the E-mailed requests that were sent throughout the year, even if you do archive these they may have actually found a swap and therefore are now no longer interested in swapping.

    Take the following example:
    John Doe has "A" but needs the leave period represented by letter "B"
    Mary Smith has "B" but needs the leave period represented by letter "A"
    This then is easy and it’s just a matter of both parties getting together and filling out the appropriate paperwork for the admin to process AKA (2Xway swap).
    But this way is obviously flawed as most staff will lose out and will not get the correct time of year that they need to be off work (ie weddings, emergencies, family (in other countries), match partners leave, etc! .. this is a real pain for most staff
    Take the following example:
    John Doe has "A", but needs the leave period represented by letter "B" (A-B)
    Mary Smith has "B", but she wish leave period represented by letter "C" (B-C)
    Tom Thumb has "F", and he needs letter "A" (F-A)
    Adam Ant has "C", but he needs leave period "G" (C-G)
    Jiminy Cricket "D", but he needs leave period "G" (D-G)
    Frank Jones "G", and he needs letter "A" (G-A)

    With the above example Tom & Jiminy would remain on the register and wait for more staff to go on the swap register. But as you can see from the below…4 Staff members will “NOW” get the leave period they require. Who otherwise would have had to miss out on an important event.
    John A-B John A – B
    Mary B-C Mary B – C
    Tom F-A Frank G – A
    Adam C-G Adam C –G
    Jiminy D-G
    Frank G-A
    OR <---------------------------------------------------------------------------------------- OR
    John A-B John A – B
    Mary C-A Mary C – A
    Tom B-C TOM B – C
    Adam C-G
    Jiminy D-G
    Frank G-A

    Not sure if it’ll help, but when I swapped the letters manually I’ve spotted a consistent pattern in the above examples,


    e.g. As long as a value within Column “A” contains the same value that’s also in Col B along with the count of each being the same then all letters within can swap, and if not they’ll remain on the register till a match values are in each column

    SO, what I need to do is create a register and then somehow be able to run some sort of formula to find the matches/swaps even it were a 4, 5 or 6.. way swap. so as our Admin staff can accommodate all our staff a lot more efficiently, that way a good number of staff will not lose out as they do every year.
    The formula is where I need the help as I don’t have much experience in pattern matching, as creating the register to hold all the staff names and letters I assume would be the easy part!
    I imaging I’d need to start by sorting on values (from A-Z ) in column A, then loop through cross ref and matching values with Column B then move these letters out into another vacant column or table if a match is found!
    Any help or advice on a viable solution would be much appreciated.

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,800
    This won't be what you want to hear, but your company is just making this far more difficult than it needs to be IMHO. If everyone were allowed to choose based on some order (such as seniority) then most should be able to get what is important to them right off the bat - no need to look for a swap because you had some period foisted on you when your spouse is never off at the same time. If it's important, you don't swap. If your choice is not important, you can trade with anyone directly and avoid having to shuffle people around in order to create some sort of opening that can't be filled until one move is made, which can't be filled until that move is made, which can't be filled until this move is made...Yikes! I worked somewhere for 40 years (in various departments) and while they all had not exactly the same rules, I never saw anything this dictatorial or complicated. If the same people always getting to pick first because of seniority would be a problem, then rotate who's first.

    Anyway, this will be an interesting thread to watch. For what it's worth, I put your scenario into a spreadsheet to see if a numerical column (one that could be switched from say, 1 to -1) to indicate something that was once available but now isn't - but it looks like my tired old brain isn't up to it.

  3. #3
    gint32 is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jan 2015
    Location
    Australia
    Posts
    116
    Quote Originally Posted by Micron View Post
    Re- this will be an interesting thread to watch...
    .
    Admittedly, yes our company has not made it easy for us on this one and on top of this are reluctant to change to any other system (hence my quest to work with what they have in place). But it’s a problem that needs to be re-solved somehow or other.
    IMHO, I still reckon pattern matching is the way to go with this as in ..meaning search Col A for exact matches in Col B with a Count of each letter being equal in both sides

    Code:
    John  A-B 
    Mary  C-A 
    Tom   B-C 
    Adam  C-G
    JiminyD-G
    Frank G-A
    Code:
     John  A – B
     Mary  C – A
      TOM  B – C
    A total of 3 X in each col with same values, therefore those staff may swap, and be removed from the list.
    Last edited by gint32; 04-02-2018 at 08:17 PM.

  4. #4
    Join Date
    Apr 2017
    Posts
    1,679
    I'm afraid you can't formalize this task for full automation. The maximum you can try is some worksheet, where swap wishes are registered, and some additional info like number of used/free leave slots is calculated. From there on someone has to make decisions.

    I made a workbook for similar task in several firms of our company. Annual leaves are distributed department-wise, so every department has his own copy of workbook. Departments decide, will they keep data of several years, or they have the workbook for current year only. How much people can be on leave at same time and further restrictions like how many employees on certain position must be on work minimally are decided by department head.

    The workbook has
    1. Setup sheet, where department info (name, department head name and other info like this) is entered, and where the active year is selected. Also are types of leaves (annual, maternity leave, study, unpaid, etc.) registered there;
    2. The sheet where the list of employees is entered with dates when employee started to work and when left (when the last is empty, it means the employee is currently working). And depending on selected year a table is filled with dates of year as columns, where for every employee days of leave are marked with 3-character code (1st character - planned/used, 2nd character - leave type, 3rd character - workday/weekend/holiday). Days where employee wasn't employed are marked also (with '-'). At top of sheet, for every day of selected year the number of employees, and the number of employees on leave are displayed, so the department head can easily detect critical situations and intervene. It is also possible to filter the whole sheet on certain employees;
    3. The sheet where employees enter periods (start and end dates) where they want to have the leave (or department head makes the entry, p.e. in case of maternity leave). This sheet serves as source table for all calculations. For every period, a separate entry is made. And this list can expand over several years (on depart heads decision). By default entered leaves are planned ones, but it is possible to mark the entry as used one.
    4. As last there is a report sheet, where the list of official leaves for year can be printed - with signatures etc. (When leave type is registered, there is a selection, is the type included into report or not).

    Edit. Somehow I was sure I was in Excel forum! Maybe some moderator can delete the post?

  5. #5
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    Arvil
    You can delete all the unwanted text yourself and just replace with a comment like 'oops I misread the post' or whatever
    I know that from experience....
    Last edited by isladogs; 04-02-2018 at 07:19 AM.
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  6. #6
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,800
    Well, here's a thought for you. If you enforced all letters to be upper case and had corresponding fields for the letter Ascii values, then you could compare the sums of their numbers? Your example would be
    Name Assigned aValue Wants Wvalue
    JOHN A 65 B 66
    MARY C 66 A 65
    TOM B 67 C 67
    Obviously the sums of the 2 fields would be equal. Given the start and end values for A - Z I think it's not possible to have two sums be equal and have different letters. The numeric range is 65 to 90. You'd probably want to count the members on each side of the sums to ensure they are the same - all done in a form, of course.

  7. #7
    gint32 is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jan 2015
    Location
    Australia
    Posts
    116
    Quote Originally Posted by Micron View Post
    Well, here's a thought for you. If you enforced all letters to be upper case and had corresponding fields for the letter Ascii values, then you could compare the sums of their numbers? Your example would be
    Name Assigned aValue Wants Wvalue
    JOHN A 65 B 66
    MARY C 66 A 65
    TOM B 67 C 67
    Obviously the sums of the 2 fields would be equal. Given the start and end values for A - Z I think it's not possible to have two sums be equal and have different letters. The numeric range is 65 to 90. You'd probably want to count the members on each side of the sums to ensure they are the same - all done in a form, of course.
    I am somewhat lost, as to how I would by totaling the figures that I would find, who can swap with who

    But, I do get that when (and if) as I stated in my O.P, figure out how to find who can swap and then in-turn isolate these, then summing / counting would be good for cross checking, but can't figure out how your scenarios would filter out the eligible candidates in the first place!
    take the following example:
    Name Assigned Avalue Wants Wvalue
    Mary C 67 B 66
    Tony D 68 C 67
    Brian E 69 F 60
    Frank A 65 D 68
    John B 66 A 65
    Ian F 70 A 65
    Liz F 70 B 66
    Harry G 71 A 65
    342 329

    how do you find the eligible from the above:

    I can visually see from the table above that it would be the following people, but not sure what or how to extract using your suggestion
    Mary C 67 B 66
    Tony D 68 C 67
    Frank A 65 D 68
    John B 66 A 65
    266 266

  8. #8
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,800
    I went by your example, which seemed to indicate you might be looking at a group of requesters. If the intent is to determine eligibility across the entire spectrum, then I don't think my idea is of any use. If you were trying to evaluate that all was well over a group of say, 4 people who had expressed the desire to swap and had discussed it among themselves, then their proposed trades might be evaluated that way. It was just a thought that it might be easier than pattern matching. It's likely that I don't understand all the finer points of the problem you have.

  9. #9
    gint32 is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jan 2015
    Location
    Australia
    Posts
    116
    Thanks, but no groups of staff presently discuss the option of anything more than a 2x way swap (yet).

    Reasons being not any of the staff have considered anything but a two way swap since that all that's available at the moment.

    It was myself who spotted the possibility of 3 of 4 way swaps..and wish to improve staff chances of swapping.

    This is the reason I am trying to come up with a better solution and if I do then I will implement it. But at the moment so far I have nothing so currently its a two way swap or nothing.

    Hence my quest, also I haven't even mentioned this as yet to admin or staff!

    ....Question..?????. (Like me). Has anyone else noticed the pattern when a viable swap is available? as I don't think anyone has ever agreed to this way of matching values(letters)

    Have another look at the below example and agree or not! and everyone forget trying to calculate for a moment!
    Code:
    John  A-B 
    Mary  C-A 
    Tom   B-C 
    Adam  C-G
    JiminyD-G
    Frank G-A
    Code:
     John  A – B
     Mary  C – A
      TOM  B – C
    IMHO, I still reckon pattern matching is the way to go with this as in ..meaning search Col A for exact matches in Col B with a Count of each "LETTER" being equal in both sides

    Meaning :
    Code:
    x2 of the letters "A" on each side 
    x2 of the letters "B" on each side
    x2 of the letters "C" on each side
    Count of each  "LETTER" being equal in both sides
    From this... I don't even have to think about who gets what, as I just know from the above that they must be able to swap regardless of the order of all letters, as they are an exact match on each side!!

    The same constant "Rule" will applies even if there are hundreds of records to evaluate!

    So, back to basics, I know what I need which is : ..I just need to find the matching values
    but I am not a programmer hence I don't know where to start.

    Thanks

  10. #10
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,800
    well, for a moment I thought of a Totals query or perhaps a cross tab (less likely) but after reading your original post, I think you might be simplifying parts of this a bit too much, or something about the examples don't/won't really match reality. After all, how could you represent 400 6 week slots with letters from A to Z without doubling them up? Seems like that would really complicate or change things. Wish I had a better idea for you.

  11. #11
    gint32 is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jan 2015
    Location
    Australia
    Posts
    116
    Quote Originally Posted by Micron View Post
    After all, how could you represent 400 6 week slots with letters from A to Z without doubling them up?
    Thanks, but I'm not Sure where you got the A-Z from, I think I've only mentioned sorting in A-Z order, our leave letters only run A<>H ..such as the following: Then the following years each letter moves to next 6wk block, that way each staff member will not always work or not work Xmas etc, so if you stay with company long enough you'll have a 6 wk block in each month of the year.
    B F E H
    12.05.17 - 22.06.17 15.09.17 - 26.10.17 27.10.17 - 07.12.17 23.06.17 - 03.08.17
    A G D C
    04.05.18 - 14.06.18 04.08.17 - 14.09.17 08.12.17 - 18.01.18 19.01.18 - 01.03.18

  12. #12
    gint32 is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jan 2015
    Location
    Australia
    Posts
    116
    Quote Originally Posted by Micron View Post
    Wish I had a better idea for you.
    from my OP...this allocated leave letter remains with you throughout your employment.
    I perhaps should clarify the above a bit more ...when a leave letter is swapped, it will only be for that swap(term), and as such next year you''ll still have the original letter allocated to you originally ( all be it that it'll be in the next range of 6week blocks)

  13. #13
    gint32 is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jan 2015
    Location
    Australia
    Posts
    116
    Quote Originally Posted by Micron View Post
    well, for a moment I thought of a Totals query or perhaps a cross tab (less likely) but after reading your original post, I think you might be simplifying parts of this a bit too much, or something about the examples don't/won't really match reality. After all, how could you represent 400 6 week slots with letters from A to Z without doubling them up? Seems like that would really complicate or change things. Wish I had a better idea for you.
    At this point I'd be happy with just resolving 3 way swaps, as its still better than the two way swaps which is what we've been doing for years, and by the sounds of it will be for many more

  14. #14
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,800
    Thanks, but I'm not Sure where you got the A-Z from
    I figured if you had 400 people involved in this (per your 1st post) you must have been using more than the few letters in your example.

  15. #15
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    Quote Originally Posted by gint32 View Post
    Thanks, but no groups of staff presently discuss the option of anything more than a 2x way swap (yet).

    Reasons being not any of the staff have considered anything but a two way swap since that all that's available at the moment.

    It was myself who spotted the possibility of 3 of 4 way swaps..and wish to improve staff chances of swapping.

    This is the reason I am trying to come up with a better solution and if I do then I will implement it. But at the moment so far I have nothing so currently its a two way swap or nothing.

    Hence my quest, also I haven't even mentioned this as yet to admin or staff!

    ....Question..?????. (Like me). Has anyone else noticed the pattern when a viable swap is available? as I don't think anyone has ever agreed to this way of matching values(letters)

    Have another look at the below example and agree or not! and everyone forget trying to calculate for a moment!
    Code:
    John  A-B 
    Mary  C-A 
    Tom   B-C 
    Adam  C-G
    JiminyD-G
    Frank G-A
    Code:
     John  A – B
     Mary  C – A
      TOM  B – C
    IMHO, I still reckon pattern matching is the way to go with this as in ..meaning search Col A for exact matches in Col B with a Count of each "LETTER" being equal in both sides

    Meaning :
    Code:
    x2 of the letters "A" on each side 
    x2 of the letters "B" on each side
    x2 of the letters "C" on each side
    Count of each  "LETTER" being equal in both sides
    From this... I don't even have to think about who gets what, as I just know from the above that they must be able to swap regardless of the order of all letters, as they are an exact match on each side!!

    The same constant "Rule" will applies even if there are hundreds of records to evaluate!

    So, back to basics, I know what I need which is : ..I just need to find the matching values
    but I am not a programmer hence I don't know where to start.

    Thanks
    I've not followed this thread closely so pardon me if I'm missing the point here.
    You're saying you already know how to check the 3 way swop will work (Count = 2 for each)
    So are you 'just' asking how to implement the change?

    If so, I suggest the following.
    a) Have a 'dummy' date block X
    b) using your John/Mary/Tom example
    Change John A –> X
    Change Mary C –> A which is now vacant
    Change Tom B –> C also now vacant
    Finally change John X-> B [/CODE]

    I use the idea on a schools calendar where term dates are Week 1 or Week 2 but holidays & in-service days are Week 0
    To swop weeks 1 & 2, I assign week 1 as week 3, week 2 as week 1 and then week 3 as week 2.
    Does that make sense?
    All done via update queries or recordsets as preferred

    If completely off the point, just ignore the post
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Calculating Annual Leave Days accrued
    By Peter Simpson in forum Queries
    Replies: 10
    Last Post: 11-16-2017, 11:29 PM
  2. syntax for annual leave roster
    By gint32 in forum Programming
    Replies: 25
    Last Post: 03-08-2015, 04:07 PM
  3. Annual Leave(vacation) Relationships
    By Rach in forum Access
    Replies: 1
    Last Post: 01-26-2013, 12:45 PM
  4. Annual Review
    By kwilbur in forum Access
    Replies: 5
    Last Post: 01-03-2012, 10:33 AM
  5. Annual Leave Planner
    By Dexter in forum Access
    Replies: 1
    Last Post: 03-01-2011, 05:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums