Hello,
I would like help finding the max value for each meter. My data is below.
Meter date hr1 hr2 hr3 hr4 hr5
123 1/1/2015 2 15 6 7 13
234 1/1/2015 40 10 3 1 0
345 1/1/2015 12 15 6 24 12
456 1/1/2015 2 18 5 6 11
567 1/1/2015 2 10 33 1 21
And I want it to look like...
Meter date MaxVal
123 1/1/2015 15
234 1/1/2015 40
345 1/1/2015 24
456 1/1/2015 18
567 1/1/2015 33
Using Query Builder
Select the two fields you want
Create a Calculated Column
Define it as Max(hr1, hr2, hr3, hr4, hr5)
data want;
set have;
MaxVal=max(of hr:);
run;![]()
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.