Hi Team,
Please assist in getting the desired output mentioned in the attached excel sheet
There are two tables. The output should be like the right table (Yellow in colour).
Kind Regards
SHiva
Amazing , thanks Richard it works....
Shiva
You need to explain the business logic behind the transformation you want.
Why are certain columns repeated in the yellow data?
Why are some cells set to null?
Is there any row level relationship between the apparent director-director, GM-GM and manager-manager entries, and if so, what is the logic?
Richard
Looks like a 2 stage exercise:
If there might be situations where an individual had more than one boss, the streams should be sorted (NODUPKEY)
On closer inspection I agree with Peter's analysis that the yellow consists of 4 separate streams, each of which is the unique relationship between adjacent levels of this (surely bogus!) hierarchy. However, to preserve the original order the data needs to be analysed using the notsorted option. Here is the code for the first 2 cols
data cols_IJ ;
set have ;
by notsorted Director ;
keep ExDirector Director ;
if first.director ;
run ;
Richard
Amazing , thanks Richard it works....
Thanks Peter for the steps ...
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.