I have a data set with two dates. The first indicates when an event happened (date1). The second when an event resolved (date2). Resolution can only take place on a weekday due to business hours.
I'm trying to figure out the best way to code in a data step to measure days until resolution (timetores) if:
1) I decide I want to not count the first weekend days only if date1 was on a weekend (i.e. weekday in (1 7)).
In other words, if date1 was on a Saturday or Sunday and date 2 was on a Monday I would want timetores to =0, as Monday was the first day with the opportunity to resolve. This timetores should be the same as if date1 and date 2 were on the same weekday. In either scenario, days after the first Monday or subsequent weekday would add +1 day.
Weekend days following the first weekend, or any weekdays if Date1 occurred on a weekday, would add +1 day as with any other day.
2) Alternatively, how would I code if I decide I want to not count any weekend days, regardless of when Date 1 took place.
In this example I basically wouldn't penalize days where resolution could not take place. So if Date1 took place on Friday, the next Monday should start with 1. If date1 took place on a Monday, the following Monday timetores would =5 (Tue=1, Wed=2, Thu=3, Fri=4, Mon=5).
Does this make sense?
... View more