Design for Timing Calculation (1 Viewer)

Minty

AWF VIP
Local time
Today, 06:55
Joined
Jul 26, 2013
Messages
10,366
Hi All,

I'm having a problem getting my head around a design, and wondered if anyone had any previous experience or relevant thoughts.

Goal: To determine when an SLA is due on a service call.

We know when a call was logged, and we have a list of SLA's which is unfortunately quite complex. Each call only has one SLA registered against it.
As an example;

24/7 either 4hr, 8hr , 16hour or next business day responses.
Mon-Friday 8:00-20:00 either 4hr, 8hr , 16hour or next business day responses.
Mon-Friday 9:00-17:00 4hr, 8hr , 16hour or next business day

Short of creating a fairly huge lookup (intermediate) table with all the permutations for each hour of the day 7 days a week I'm struggling with a concept of how to achieve this.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 00:55
Joined
Feb 28, 2001
Messages
27,140
Part of your problem is that you are thinking in flat-file format, which means "Excel-like" for all practical purposes. That is why you are asking about a humongous table.

I might do something like this (and beware, I'm shooting from the hip.)

1. A table of calls, with among other things, the time logged and a link to the applicable agreement - BUT... the link to the applicable agreement might be through the name of the customer in another table and the actual link to the SLA category might be in the customer's entry in that second table. (I would do it that way.)

2. So... the call has the foreign key of the customer, which suggests a drop-down on the form you use and the drop-down is based on your customer list.

3. When you enter the customer, you select one of the possible SLA formats. Note that the SLA number doesn't have to be the SLA format. You COULD have another table of SLAs that lists the customer FK number and has the SLA as the prime key, but instead of having the details in the SLA, it sounds like you have a limited number of attributes. You can have another table of SLA response formats that include:

a. Service days - either Mon-Fri or Mon-Sun
b. Start of service per day - Either 00:00 ( midnight) or 08:00 or 09:00 etc.
c. Duration of service per day - either 24 or 16 (for the 08:00-20:00 case) or 10 (for the 09:00 - 17:00 case), etc.
d. Guaranteed response time - 4, 8, 16. Saying "next business day" is redundant because the answer is ALWAYS going to be "next business day." What varies is the start of the next business day, not the fact of response being on the next business day.

Now write a VBA function for which you give it the date/time of the call and four items I just described to you. From there, you can write code that says "compute the response limit based on the call start" and return a date/time.

Questions you have to answer (and will have to implement in the function) are:

Is it the 24/7 case? Then add the max response to the call time and that is your latest possible arrival time to be within the SLA

Is it one of the other cases? Then add the max response to the call time and see if that exceeds the (computed) latest response allowed under the SLA. I.e. if the SLA says 09:00 to 17:00 and you get a call at 12:00, a response limit of 4 hours is still today but a response limit of 8 hours is next business day.

Something you need to address is whether you automatically put calls at the start of the next business day or whether you can do some lag time. I.e. if the call comes in at 16:00 on a 4-hour SLA for 09:00 to 17:00, does the SLA say you must respond by 09:00 (start of next business day) or at 12:00 (1 hour from the day of the call plus 3 hours left over.)

The last thing you have to consider in the subroutine is whether the projected "next business day" is tomorrow or Monday (because the call came in late Friday on an SLA that was not 24/7). But that is easy enough because there are functions in VBA that can return the day of the week as a number from 0 to 6 or if you use FormatDateTime, you can return the name of the day of the week and do your tests on that.

The result of all of this computation goes back into the call ticket as the "computed latest response under SLA." NOTE: This might appear to violate a popular guideline often offered regarding storing a computation - but given that the customer might renegotiate a different SLA next year, it might be easier to just remember the latest condoned response, particularly if you were planning to do "efficiency" stats by comparing arrival time to latest allowed arrival time later.

The secret to doing this is to remember the advice of old Julius... divide and conquer. Break up the problem into pieces-parts and attack them separately.
 

Minty

AWF VIP
Local time
Today, 06:55
Joined
Jul 26, 2013
Messages
10,366
Part of your problem is that you are thinking in flat-file format, which means "Excel-like" for all practical purposes. That is why you are asking about a humongous table.

I might do something like this (and beware, I'm shooting from the hip.)

1. A table of calls, with among other things, the time logged and a link to the applicable agreement - BUT... the link to the applicable agreement might be through the name of the customer in another table and the actual link to the SLA category might be in the customer's entry in that second table. (I would do it that way.)
We have a call header that has the call logged time - this is logged against a specific piece of equipment, that in turn is stored against a contract against a customer. The SLA is contract specific (At the moment - we are possibly going to look at moving it to being equipment specific, but that is another story).

3. When you enter the customer, you select one of the possible SLA formats. Note that the SLA number doesn't have to be the SLA format. You COULD have another table of SLAs that lists the customer FK number and has the SLA as the prime key, but instead of having the details in the SLA, it sounds like you have a limited number of attributes. You can have another table of SLA response formats that include:

a. Service days - either Mon-Fri or Mon-Sun
b. Start of service per day - Either 00:00 ( midnight) or 08:00 or 09:00 etc.
c. Duration of service per day - either 24 or 16 (for the 08:00-20:00 case) or 10 (for the 09:00 - 17:00 case), etc.
d. Guaranteed response time - 4, 8, 16. Saying "next business day" is redundant because the answer is ALWAYS going to be "next business day." What varies is the start of the next business day, not the fact of response being on the next business day.

Actually slight oversight there on my behalf - for 24/7 its next day, for the others its NBD
I think the problem is that currently the SLA list is exactly that and not broken down into it's constituent parts, and I think i'm going to have to normalise it to get to the model you quite correctly suggest.
Now write a VBA function for which you give it the date/time of the call and four items I just described to you. From there, you can write code that says "compute the response limit based on the call start" and return a date/time.
This Makes Sense
Something you need to address is whether you automatically put calls at the start of the next business day or whether you can do some lag time. I.e. if the call comes in at 16:00 on a 4-hour SLA for 09:00 to 17:00, does the SLA say you must respond by 09:00 (start of next business day) or at 12:00 (1 hour from the day of the call plus 3 hours left over.)
The latter is the case for us and I guess this is where some of the difficulty was in my head. It's just a case of writing the function correctly to accommodate all the variants, which as you point out is not quite as daunting as I first thought.
The result of all of this computation goes back into the call ticket as the "computed latest response under SLA." NOTE: This might appear to violate a popular guideline often offered regarding storing a computation - but given that the customer might renegotiate a different SLA next year, it might be easier to just remember the latest condoned response, particularly if you were planning to do "efficiency" stats by comparing arrival time to latest allowed arrival time later.
I think trying to recalulate this on hundreds of calls a month would be a significant pain for anyone writing reports so yes, and yes contracts get renewed with different SLA's - I was going to store it!
 

Users who are viewing this thread

Top Bottom