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.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 1521 views
  • 0 likes
  • 3 in conversation