Hi All,
I do not know how to use MAX IF function in SAS EG so that I can get the following output.
Given the left two columns, how can I get the output table (table only, not report) like below? Prefer using EG Query Builder, if cannot, code is also good for me. Thank you so much!
School | Score | Max Score of the School | Min Score of the School |
---|---|---|---|
IT | 98 | 98 | 70 |
Biz | 80 | 99 | 80 |
Biz | 88 | 99 | 80 |
Law | 97 | 97 | 84 |
IT | 70 | 98 | 70 |
Law | 84 | 97 | 84 |
IT | 78 | 98 | 70 |
Biz | 99 | 99 | 80 |
Law | 86 | 97 | 84 |
The easiest point-and-click method is two queries: first to calc the Min/Max for each school group, then the second to join that result with the original detail.
In screen shots, with this data:
STEP 1:
STEP 2:
The flow:
Result:
Chris
The easiest point-and-click method is two queries: first to calc the Min/Max for each school group, then the second to join that result with the original detail.
In screen shots, with this data:
STEP 1:
STEP 2:
The flow:
Result:
Chris
Hi Chirs,
Thank you very much. I found that actually just the second step is enough. MAX(score) Group by school.
Thanks
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.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.