Hi Everyone, I am trying to build a Hierarchy from the below file (source code title: code 1). The first level of the hierarchy should be CEO, and every subsequent level (represented by L2, L3 etc) should be correct. One way of doing this is - Loop through all the Ls and identify the first L with a value of CEO. - The first L with a value of CEO will be Level 1, then the rest of the levels will automatically fall into place with Level 2 being Department Head, Level 3 being Senior manager etc. - Once Levels are defined as such, these could be appended to give a table like table 2 below; Note: This is extremely simplified. Original table contains about 100k records code 1: data Ranking; INFILE DATALINES DLM=','; length CustID L1 $20 L2 $20 L3 $20 L4 $20 L5 $20 L6 $20; input CustID L1 $ L2 $ L3 $ L4 $ L5 $ L6 $; cards; 1,CEO,Department Head,Senior Manager,Manager, Senior Analyst, Peter 2,Major,Vice President, CEO, Department Head, Senior Manager,Manager 3,Technical Chief, CEO, Department Head, Senior Manager, Manager, Senior Analyst ; The Finished product should look like this: Can anyone think of a scripting that will get this result please? Thanks,
... View more