BookmarkSubscribeRSS Feed
Jaheuk
Obsidian | Level 7
dear all,
i am using a PROC SUMMARY to calculate the MAX value per year/week.
I also want to know in which week this max value occured so i tried to
use the ID statement.
But this does not work because the proc gives me the max week for the
specified group.
This is also stated in the sas help!!

How can i get my wanted info (without writing datasteps of course 😉


GreetZ,
Herman
2 REPLIES 2
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Your CLASS or BY statement must also include some SAS variable(s) to identify the year/week (likely a week-start date). The ID statement is not for this purpose, I would say.

Scott Barry
SBBWorks, Inc.
Paige
Quartz | Level 8
If you want to know which week (out of the 52 weeks per year) has the maximum value per year (I hope I am understanding you properly), then try the MAXID option of the OUTPUT statement.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 2 replies
  • 2020 views
  • 0 likes
  • 3 in conversation