Date: Thu, 30 Jul 2009 11:17:25 -0500 OR Stats "SAS(r) Discussion" OR Stats Re: Split Dataset into 1st, 2nd, 3rd, 4th week of the month To: "Nordlund, Dan (DSHS/RDA)" <941871A13165C2418EC144ACB212BDB0BEB465@dshsmxoly1504g.dshs.wa.lcl> text/plain; charset=ISO-8859-1

Hi Dan: Thanks for your question, I am thinking about the problem more carefully and need to revise the definition to be more accurate...

My data is daily historic product volume. However, the daily volume references a new product each month. When one product offering ends towards the end of the month, a new product offering is open. I am interested in studying the volume in the first, second, third, and fourth week from when a new product is launched over time.

Each month, I have a *termination date* (for when the current month's product offer ends) that falls on a workday date that is near to the end of the month. The termination date is *variable*, but known for my entire daily dataset.

So 'monthly' product is a soft defn of month, because for

'Oct' 2009 product: volume is collected for this offer beginning Sep 29 - Oct 28, 2009 = 22 days 'Nov' 2009 product: volume is collected for this offering beginning Oct 29 - Nov 24, 2009 = 19 days

For my daily volume data for the 'Oct' product offering, I would like to divide Sep 29-Oct 28 into *day1-5, day6-10, day11-15*, *day16-*22. For my daily volume data for the 'Nov' product offering, I would like to divide Oct 29-Nov 24 into day1-5, day6-10, day11-15, day16-19.

Of course, I have no volumes on *weekends *and *holidays*, so in my dataset the dates are not absolutely continuous to code simply +5 for example.

For every month product, the range of dates for the 5 volume days are variable depending on weekends/holidays. This makes it tricky.

I would greatly appreciate all your suggestions as the problem of coding this is boggling. On Thu, Jul 30, 2009 at 10:21 AM, Nordlund, Dan (DSHS/RDA) < NordlDJ@dshs.wa.gov> wrote:

> > -----Original Message----- > > From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of OR > > Stats > > Sent: Thursday, July 30, 2009 8:07 AM > > To: SAS-L@LISTSERV.UGA.EDU > > Subject: Re: Split Dataset into 1st, 2nd, 3rd, 4th week of the month > > > > Thanks, Kevin for pointing that out. The defn for our purposes is > > > > If the 1st of the month falls during the business week (Mon, Tue, .. > Fri), > > the first week of the month is the week of the 1st. > > > > If the 1st of the month falls during the weekend (Sat or Sun), the first > > week of the month is the full week there following > > . > > So take two extreme cases > > > > E.g., Jun 1, 2009 was on a Monday > > Mon 6/1- Fri 6/5 is the 1st work week > > Mon 6/8- Fri 6/12 is the 2nt work week > > Mon 6/15 - Fri 6/19 is the 3rd work week > > Mon 6/22 - Fri 6/26 is the 4th work week > > > > Aug 1, 2009 is on a Saturday > > Mon 8/3 - Fri 8/7 is the 1st work week > > Mon 8/10 - Fri 8/14 is the 2nd work week > > Mon 8/17 - Fri 8/21 is the 3rd work week > > Mon 8/24 - Fri 8/28 is the 4th work week > > > > Would greatly appreciate the syntax in coding this with respect to the > dates > > that I have. > > So, just to be clear, for October 2009 what days should be included in the > first week of the month? > > Dan > > Daniel J. Nordlund > Washington State Department of Social and Health Services > Planning, Performance, and Accountability > Research and Data Analysis Division > Olympia, WA 98504-5204 >

Back to: Top of message | Previous page | Main SAS-L page