# Future Events Calculations

## Recommended Posts

I am racking my brain for a solid solution to scheduling problem.

I have a system where the client had weekly events schedule, except for holiday and other closurs. A list a date would be supplied to clients so they didn't come in on the weekly appointment on closure days.

To do this, I had fields for each day of the week, and start and end dates for the seasons. Then populated each field with a script that took the start day, and added 7 until the end date. Then allowed the user to take off closure dates and then the list for the relevant day was supplied the client.

A new requirement is to add the option for appointments of either weekly, or 2 groups with every other week. So one client could be every week, another could start with every other week starting 1/1/12 and another every other week starting 1/8/12.

The trick is making a fool-proof way to make lists for the every-other week clients. I can't just take every other date, because there could be 2 closures in a row, and would throw all the rest of the list.

Seems the only way the do with would be to take the list of dates and test if each date in the list is 14days past the old one, and then keep it. Seem very cumbersome or and difficult to do in Filemaker.

Looking like a technique to tackle this. Any ideas?

Thanks

##### Share on other sites

It sounds like your 'business logic' is very algorithmic and therefore you will want to create a looping script that recreates the logic of how you assign dates. You're going to want to keep a reference table of open or closed dates. Your script would check a potential appointment against this reference and then make accommodations according to your policy.

##### Share on other sites

Then populated each field with a script that took the start day, and added 7 until the end date. Then allowed the user to take off closure dates and then the list for the relevant day was supplied the client.

First, you should be using records in a related table for the actual dates, not fields. Next, there is no real difference between weekly and bi-weekly: you simply keep adding either 7 or 14 days in a loop.

I can't just take every other date, because there could be 2 closures in a row, and would throw all the rest of the list.

I didn't understand this part. IMHO, you should check each proposed date against a list of holidays before adding it to the list.

##### Share on other sites

Thanks.

I did end up reworking it all so the are all records. Then used calculated keys to filter out the alternate weeks.

##### Share on other sites

I am not sure why you need to create them first, then filter them out - instead of not creating them at all to begin with.

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×

×
×
• Create New...