From: sas analysis on
Hi All,

If I have a bunch of grades for students over terms. How do I select
the worse grade.

Here is how the data looks:

Student Grade 1 Grade 2
X 50 70
X 40 80
X 30 90
Y 70 67
Y 60 66
Y 80 64

This is how I want the data to look:

Student Worse Grade
X 50
X 40
X 30
Y 67
Y 60
Y 64

Thank you for the input!
From: Reeza on
On Apr 7, 8:15 am, sas analysis <sasanaly...(a)gmail.com> wrote:
> Hi All,
>
> If I have a bunch of grades for students over terms. How do I select
> the worse grade.
>
> Here is how the data looks:
>
> Student       Grade 1        Grade 2
> X                   50                  70
> X                   40                  80
> X                   30                  90
> Y                   70                 67
> Y                   60                 66
> Y                   80                 64
>
> This is how I want the data to look:
>
> Student        Worse Grade
> X                        50
> X                        40
> X                        30
> Y                        67
> Y                        60
> Y                        64
>
> Thank you for the input!

Use the minimum function. However if a student has a grade missing
you will also need to check for that and decide how you want to handle
it.

worse_grade=min(grade1, grade2)

minimum will take multiple arguments.

HTH,
Reese