BookmarkSubscribeRSS Feed
Pooja98
Fluorite | Level 6

Hi all,

 

i got some data on daily basis, but i want to convert it into weekly basis

i need it like on Saturday -Friday basis

For example,

 

1. 09-06-21

2. 14-06-21

3. 05-06-21

4. 11-06-21

5. 28-06-21

6. 25-06-21

7. 04-06-21

 

where No.7 lies in one week, whereas No.1,3,4 lies in another week.

my data contains record from 2019, but i need it on weekly basis.

It will be helpful if its available in both SAS and excel solution.

 

Thanks In Advance

3 REPLIES 3
ballardw
Super User

I am not sure what your desired output would look like. You need to provide an example of the expected output.

 

First question, are your "dates" actually SAS date values? Show us the variable type and format from Proc Contents for your variable.

Ksharp
Super User
Check function WEEK() .
Kurt_Bremser
Super User

SAS procedures (except SQL) that do summarizing will honor formatted values of class/group variables, so there you only need to use a week-based format.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 507 views
  • 0 likes
  • 4 in conversation