BookmarkSubscribeRSS Feed
kkashy
Calcite | Level 5

Hi All, 

New to SAS here, so please bare with me if this is a simple fix. 

Below is a screenshot of some of the data I am utilising. 

SAS1.1.JPG

Using the query builder, I converted the t1.date into weekays, ie. Monday, Tuesday using format DOWNAME. 

SAS 1.2.JPG

I am now trying to get an overall weekday average of the data. This should be in the form (as an example)

date               Aluminium

Monday         16.6

Tuesday         7.8

etc until Sunday for all data points. 

This data is tangible for the last 3 months, where I currently have the report running for today to 3 months ago.

Any help to get this output would be greatly appreciated. 

 

1 REPLY 1
Shmuel
Garnet | Level 18

Try next code:

proc means data=have noprint;
   class date;
   format date downame;
   var Aluminium;
   output out=want mean=Average ;
run;

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 551 views
  • 0 likes
  • 2 in conversation