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 ...
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.
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.