Deadline Dates

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Deadline Dates

DEBOER
Hi,

I would like to add a deadline date in my data. I work with Service level Agreements(SLA) and I need to find out if we processed according to SLA. We have 6 workingdays to deliver

1. We recieve a product (Reicevedate), that date cant be a weekend or bankday or red day. I.e if i recieve a product on 2014-06-29, thats a sunday received date have to be on the nextday(monday 2014-06-30) if monday was a bankday then the reiceved is that next day and so on.

2. When I have the received date I simply add 6 days on it to get the deadline date. The problem there is to get SPSS to consider Bank-/red days and weekends.

Ex

RecievedDate  New_receiveddate   Deadlinedate  True_deadlinedate

2014-12-21      2014-12-22          2014-12-28      2015-01-07

1. If i receive a product 2014-12-21 thats a sunday, the received date adjusts to New_receivedate
2. if we add 6 days on the receiveddate, deadline=2014-12-28. (i need to add 6 workingdays)
3. The True_dealinedate counts;2014-12-22,23,29,30,2015-01-02 and 2015-01-07 as workingdays
Excluding 2014-12-24,25,26 as red days; 2014-12-27,28 as weekend, 2014-01-31 and 2015-01-01 reddays; 2015-01-03,04 weekend; 2015-05-05, 06 reddays.

Is there a syntax  which can give me New_receiveddate and "True_deadlinedate"?

Obs I have this syntax.


* Just a baseline normal number of days* .
COMPUTE DAYS =CTIME.DAYS(closeddate-RecievedDate  ).

*Note dates are stored in seconds, 86400 per day * .
COMPUTE WKDAYS=0.
LOOP #=RecievedDate   to closeddateBY 86400.
* You have to add all applicable public holidays in next ANY command below.
If RANGE(XDATE.WKDAY(#),2,6) & ~ANY(#,DATE.DMY(24,12,2014),DATE.DMY(25,12,2014),DATE.DMY(26,12,2014),DATE.DMY(31,12,2014,
DATE.DMY(1,1,2015),DATE.DMY(5,1,2015),DATE.DMY(6,1,2015)) WKDAYS=WKDAYS +1.
END LOOP.
EXECUTE.

But this is based on that we have closed the product. Then I can calculate how many days.

I need to calculate the Deadlinedate in order to know our workload and therefore calculate FTEs needed.

Manys thanks
Reply | Threaded
Open this post in threaded view
|

Re: Deadline Dates

Maguin, Eugene
Here's a first pass through the problem. I understand that this is an production level issue, that is, this is something that has to be attended to every day, rather than a one-time problem. The production solution might be quite different. That said,

The Sunday problem.
If (xdate.wkday(receivedate) eq 1) receivedatee=datesum(receivedate,1,"days","rollover").

The bankday and/or redday problem.
Is this day/are these days predictable, i.e., do they have exploitable structure? Important to know!

Well, suppose they don't have structure.
On a one-time basis, I'd code the dates in a vector and then test the receivedate against the dates in the vector. Basically this:
Vector specials(10,A10).
Compute specials1='06/23/2014'.
Compute specials2='07/04/2014'.
Etc.
*  I do not think that you can declare special to be adate10 and then put the value 11/12/2105 into it. Thus, input as strings. Then:
Alter type specials1 to specials10(adate10).
Loop #=1 to 10.
If (receivedate eq specials(#) >date fixup follows here<.
End if (receivedate gt specials(#)).

At the production level, I think I'd make as specials file consisting of one record with all the special dates listed (adate10 format) and then as part of the deadline update run, do a match files table to add the dates to every record in the deadline file and then test receivedates against the special dates  and adjust as needed, and lastly, delete the specials variables. I haven't used the spss production facility for several years but I'd guess this could be set up as a production job. One additional improvement would be to assume the from time period to time period the number of special dates might vary and then add a variable for this number into the specials file. Then modify the syntax to use that number to control the looping.

Loop #=1 to nspecials.
Etc.

Gene Maguin


-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of DEBOER
Sent: Monday, June 30, 2014 5:29 AM
To: [hidden email]
Subject: Deadline Dates

Hi,

I would like to add a deadline date in my data. I work with Service level
Agreements(SLA) and I need to find out if we processed according to SLA. We have 6 workingdays to deliver

1. We recieve a product (Reicevedate), that date cant be a weekend or bankday or red day. I.e if i recieve a product on 2014-06-29, thats a sunday received date have to be on the nextday(monday 2014-06-30) if monday was a bankday then the reiceved is that next day and so on.

2. When I have the received date I simply add 6 days on it to get the deadline date. The problem there is to get SPSS to consider Bank-/red days and weekends.

Ex

RecievedDate  New_receiveddate   Deadlinedate  True_deadlinedate

2014-12-21      2014-12-22          2014-12-28      2015-01-07

1. If i receive a product 2014-12-21 thats a sunday, the received date adjusts to New_receivedate 2. if we add 6 days on the receiveddate, deadline=2014-12-28. (i need to add
6 workingdays)
3. The True_dealinedate counts;2014-12-22,23,29,30,2015-01-02 and 2015-01-07 as workingdays Excluding 2014-12-24,25,26 as red days; 2014-12-27,28 as weekend, 2014-01-31 and 2015-01-01 reddays; 2015-01-03,04 weekend; 2015-05-05, 06 reddays.

Is there a syntax  which can give me New_receiveddate and "True_deadlinedate"?

Obs I have this syntax.


* Just a baseline normal number of days* .
COMPUTE DAYS =CTIME.DAYS(closeddate-RecievedDate  ).

*Note dates are stored in seconds, 86400 per day * .
COMPUTE WKDAYS=0.
LOOP #=RecievedDate   to closeddateBY 86400.
* You have to add all applicable public holidays in next ANY command below.
If RANGE(XDATE.WKDAY(#),2,6) &
~ANY(#,DATE.DMY(24,12,2014),DATE.DMY(25,12,2014),DATE.DMY(26,12,2014),DATE.DMY(31,12,2014,
DATE.DMY(1,1,2015),DATE.DMY(5,1,2015),DATE.DMY(6,1,2015)) WKDAYS=WKDAYS +1.
END LOOP.
EXECUTE.

But this is based on that we have closed the product. Then I can calculate how many days.

I need to calculate the Deadlinedate in order to know our workload and therefore calculate FTEs needed.

Manys thanks




--
View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Deadline-Dates-tp5726613.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD