SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

Hierarchy Programming - Constraints- HELP!

Reply
Occasional Contributor
Posts: 18

Hierarchy Programming - Constraints- HELP!

Hello I have the following dataset but I am really stuck on how to do the hierarchy for few weeks actually. Any suggestions would be GREATLY appreciated!! Thank you!

 

Here are the rules:

If the group contains > 20 on any instance or then it should be code as 'TOO HIGH' or if it is between 16-20 TWICE in a row

If the group is between 11 through 15 twice in a row, then it should be 'HIGH' 

If the group is between 6 through 10 twice in a row, then it should be 'Low'

If the group is between 1 through 5 twice in a row, then it should be 'Normal'

 

Basically if the two consequentive events don't happen by top hierarchy (too high), you skip to the next level (high, low, normal, etc)

 

Here is the dataset

IDvalueseq_id
131
112
123
144
115
2201
2212
253
311
362
373
314
345
3216
3177
318
329
461
492
4123
4134
511
562
573
5144
5205
6111
6122
6253
6164
6215

 

 

Here's the output I am looking for:

 

IDvalueseq_idoutput
131Normal
112 
123 
144 
115 
2201Too High
2212 
253 
311 
362 
373 
314 
345 
3216Too High
3177 
318 
329 
461 
492 
4123High
4134 
511 
562Low
573 
5144 
5195 
6111 
6122 
6253Too High
6164 
6215

 

 

Regular Contributor
Posts: 191

Re: Hierarchy Programming - Constraints- HELP!

What is the reason that you want to put the info on the first value of the 2?

 

If there are multiple rulestrue for the same ID, you only want the largest (too high-high-low-normal)?

Ask a Question
Discussion stats
  • 1 reply
  • 193 views
  • 0 likes
  • 2 in conversation