BookmarkSubscribeRSS Feed
Beto16
Obsidian | Level 7

hi I have a question on a request that came in...

i have a table that has data that looks like this

 

Machine.           Date.           Load.             Differ

a1.                     02/01/16.       160.               140

a1.                     02/06/16.         40.                 120

i need to get the first load 160 and last differ 120  to get % usage 

sometimes the load might be pervious month because they get service monthly so I would need to get load of pervious month 

 

machine.               date.           Load.            Differ

a2                       01/25/16.     160.               80

a2.                       02/06/16.      40.                120

 

 

4 REPLIES 4
Reeza
Super User

1. What do you want as your output?

2. Please post some more data and examples. I have a feeling your situation is a bit more complex and we're missing details.

Beto16
Obsidian | Level 7

Machine. Date. Load. Differ
a1. 02/01/16. 160. 140
a1. 02/08/16. 40. 120

 

out put 

machine.       Date.       Load.    Differ

a1.                2/08/16.      160.      120 

 

the latest date overrides the earliest but I need the load amt of 160 and the latest 120 


i need to get the first load 160 and last differ 120 to get % usage
sometimes the load might be pervious month because they get service monthly so I would need to get load of pervious month

machine. date. Load. Differ
a2 01/25/16. 160. 80
a2. 02/06/16. 40. 100

 

out put
machine. Date. Load. Differ
a1. 2/06/16. 160. 100

ballardw
Super User

Are the dates SAS date value numerics or character?

Do you have any rules about something like a second load 160 appearing before a 120? Or extremely long gaps between the two, say 3 months?

Beto16
Obsidian | Level 7

The date is numerical ....what is happening the machine was max loaded at 160. It was reduced  40 ..... So when I try to get percentage of usage it would show a negative I was advised not to use the load of 40 but previous load which would be 160 so my percentage of usage would not be negative .... For example if load on 01/01/16. On machine S1.   Was max loaded at 160  and only 60was used differ is 100so on 01/08/16 on machine S1 the load is 40 but it's carrying amt of 100from first load     To get usage 100/40 would be in negative if I can use the load on 01/01/16 the load of 160  with 100 +40  140/160 ....

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1298 views
  • 0 likes
  • 3 in conversation