Select a list of dates to exclude from future bookings.

Good Evening

 

I am trying to implement my holiday table into a formula to ensure that future visits cannot be booked on holiday days for each member of staff.

 

To complicate things, I am trying to get the system to book 8 weeks after the previous visit eg.

WORKDAY([Date],40)

So essentially I would want the above formula to skip certain dates based on a staff members specific holiday column.

I think I need to use "SELECT" or "EXTRACTDATES" in combination with an "IF" rule to match specific staff holidays, but the complexity is a bit beyond me.

 

Have been scratching my head on this for weeks and havent found any similar issues in the help forums.

Hopefully someone can help.

Cheers

Matt 

 

 

 

0 10 393
10 REPLIES 10

You may need to share a couple of examples of your requirement so that the community could suggest better. 

However since you mentioned a list of holidays to be excluded , you may want to take a look at AppSheet WORKDAY() function's help article, just in case you have not. 

The function has option to exclude a list of dates.

https://help.appsheet.com/en/articles/2357330-workday

Thanks

 

I have looked the link again, The problem is that the example I want to use:

WORKDAY("12/1/2019", 25, LIST("12/24/2019", "12/25/2019", "1/1/2020")) : 1/8/2020

does not come with explanatory text.

 

The above formula looks like the sort of thing I need, but I would like to get that list to change, dependent on which user is making the booking.

i.e Bob has holiday on 1/1/22 (contained in his own column in a holiday spreadsheet), He books his next visit for 8 weeks after today and it will skip his holiday.

Something like:

WORKDAY([Visitdate], 40, IF(EXTRACTDATES([Bobs Holidays]),Bob = user)

Or in english, as I am terrible at coding:

Create a date 8 weeks after the visit date using Bobs holiday list if Bob is the user.

 

Hopefully this is clearer

Any assistance greatly appreciated.

Where the holidays of various users are stored? Can you share the structure of that table?

Also in which table [Visitdate] is there?

Holiday table looks like this:

 

AllAllBobJImFred
Good Friday15/04/202207/04/202219/04/202225/03/2022
Easter Monday18/04/202219/04/2022  
Early May Bank Holiday02/05/2022   
Spring Bank Holiday02/06/2022   
Platinum Jubilee bank holiday03/06/2022   
Summer Bank Holiday29/08/2022   
Boxing Day26/12/2022   
Christmas Bank Holiday27/12/2022   
     

 

Visit date (or date) is part of an automation that will add a new row to a schedule table:

 

Mattman3000_0-1648804078642.png

 

You may wish to redesign your holiday table as it is not as per recommended practices. If  another person joins the team, you will need to add a column to the table and if someone leaves you may need to delete that column. Also column of "All" will need to be added in holidays of all people.

You may wish to read the following articles

https://help.appsheet.com/en/articles/1100263-app-design-101

https://help.appsheet.com/en/articles/895267-data-the-essentials

Instead you may wish to evaluate having holidays and leave table something like

IDDateHoliday TypeEmployee NameHoliday Name
214632415-04-2022Public HolidayAllGood Friday
B95BED5818-04-2022Public HolidayAllEaster Monday
5F9E4D8E02-05-2022Public HolidayAllEarly May Bank Holiday
6ABCB3A602-06-2022Public HolidayAllSpring Bank Holiday
73ABF95803-06-2022Public HolidayAllPlatinum Jubilee bank holiday
655B6B7A29-08-2022Public HolidayAllSummer Bank Holiday
C37317E626-12-2022Public HolidayAllBoxing Day
D4CF236F27-12-2022Public HolidayAllChristmas Bank Holiday
E06891CA07-04-2022Employee HolidayBobBob-Personal-E06891CA
7545302B19-04-2022Employee HolidayBobBob-Personal-7545302B
DF3188EB19-04-2022Employee HolidayJimJm-Personal-DF3188EB
45C688E525-03-2022Employee HolidayFredFred-Personal-45C688E5

In general your expression for Bob's appointment could be 

WORKDAY([Visitdate], 40, SELECT(HolidaysTable[Date], OR([Employee Name]="All", [Employee Name]="Bob")))

Note: Please take above as suggestions only. Please do evaluate your app requirements and design fully at your end before proceeding. It will not be possible in the community forum to continuously suggest at app design level.

Many thanks for you suggestions so far.

 

Would it be possible to load holidays into the schedule directly and then virtually block off that day for the user?:

 

IDDateCustomerEmployerDescription

72D032BB

18-04-2022Mrs SmithBob.........
D67678D818-04-2022Mrs JonesFred......
8040FFD218-04-2022Bob HolidayBob......
B95BED5818-04-2022Public HolidayAllEaster Monday
EDD0FC5022-04-2022Mrs PhillipsFred..........
E96642EC22-04-2022Mr LewisBob......
6F9E4DUE02-05-2022Public HolidayAllEarly May Bank Holiday
5F9E4D8E02-06-2022Public HolidayAllSpring Bank Holiday
8E8A225903-06-2022Fred HolidayFred......
F144E7D502-06-2022Mr JohnsonFred........
6ABCB3A604-06-2022Mr Adams Bob ......

 

Also how would the formula you provided include the holiday dates of Jim and Fred?

 

Very grateful for your help so far, thanks again.

As mentioned, without knowing details of your schedule and app table relations, it will be difficult to provide precise direction.

The Bob example shows just as an indicator. Depending on your app design, you will need a generic expression that will pull data for one or more employers.

May I request you to take a look at many similar template apps under the option https://www.appsheet.com/templates

None of the apps exactly match your requirements but you will get idea by looking at attendance, scheduling type of apps.

Thank you, unfortunately the app templates are too basic for what I am trying to achieve.

 

"A generic expression that will pull data for one or more employers" is exactly what I need help with. I feel sure that there is an expression that can be used to achieve my goal so will try and use what you have shown, to make it work.

 

Thanks again

Yes, I am also sure an expression can be created. If you share the table relations and what you are trying to achieve in more details,  the community could possibly suggest.

Top Labels in this Space