mmichaelx
mmichaelx

Reputation: 95

SAS - INTNX Defining a Week

I have been using a SAS code I have written to group a historical dataset (that gets updated weekly) by grouping them into weeks (Sunday - Saturday = 1 group). I have been using INTNX.

Our definition of a week has now changed and is Tuesday through Monday. How can I update the code below to make that adjustment. I have been messing with the 'Week' function and trying to add days to the end to make this change but to no success.

Currently, I am using:

WEEKOF = INTNX('Week', SasDate,0);

Where "SasDate" is the date of each record in my dataset.

Any help would be greatly appreciated.

Thanks, Michael

Upvotes: 1

Views: 3694

Answers (1)

Chris J
Chris J

Reputation: 7769

Simply change it to

weekof = intnx('week.3',sasdate,0,'beginning') ;

Sun = 1, Mon = 2, Tue = 3, etc.

Upvotes: 4

Related Questions