Desktop productivity for business analysts and programmers

MAX function by variable

Reply
N/A
Posts: 0

MAX function by variable

I am looking to use the MAX function, but I want it to find the MAX by different variable groupings. How do I do this?
N/A
Posts: 0

Re: MAX function by variable

You can try something like this:

PROC SUMMARY DATA=my_data NWAY;
CLASS by_var1 byvar2;
OUTPUT OUT=my_output MAX(var1 var2 var3)=var1 var2 var3;
RUN;

(there is also the option maxid to preserve some id variable (eg: names, data, time, etc...))

Best regards
Jaroslav Message was edited by: Jaroslav
Ask a Question
Discussion stats
  • 1 reply
  • 122 views
  • 0 likes
  • 1 in conversation