Please help.
The sum statements work; however, when I add the GPA statements, this does not work.
Any suggestions. I will need averages for other fields. What am I doing wrong??
SELECT Term, Sum(CASE when apc Not Like "YN" then 1 else 0 end) AS Applicants,
avg(CASE when GPA = apc Not Like "YN" then gpac end)as AvgApplicantGPA,
Sum(CASE when apc like "A%" or apc like "S%"
then 1 else 0 end)AS Admits, Avg(CASE when apc like "A%" or apc
or apc like "S%" then GPAC)AS AvgGPA Admits
FROM TEMP
GROUP BY Term;
quit;
This is a sample of the results I want.
Term APPS App Admit
GPA Admits GPA
1990 29 3.69 19 3.89
2000 31 3.59 17 3.82
2001 36 3.83 23 4.03
Thank you.!
The sum statements work; however, when I add the GPA statements, this does not work.
Any suggestions. I will need averages for other fields. What am I doing wrong??
SELECT Term, Sum(CASE when apc Not Like "YN" then 1 else 0 end) AS Applicants,
avg(CASE when GPA = apc Not Like "YN" then gpac end)as AvgApplicantGPA,
Sum(CASE when apc like "A%" or apc like "S%"
then 1 else 0 end)AS Admits, Avg(CASE when apc like "A%" or apc
or apc like "S%" then GPAC)AS AvgGPA Admits
FROM TEMP
GROUP BY Term;
quit;
This is a sample of the results I want.
Term APPS App Admit
GPA Admits GPA
1990 29 3.69 19 3.89
2000 31 3.59 17 3.82
2001 36 3.83 23 4.03
Thank you.!