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;

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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
  • 630 views
  • 0 likes
  • 2 in conversation