I have a data set similar to the example at the bottom. The example represent two sets of variables. Set #1 is advfnl1 - advfnl6 and set #2 is advfnl1_c - advfnl6_c. My goal is to create 4 new variables and take the top 2 from the advfnl1 - advfnl6 set and the top 2 from the advfnl1_c - advfnl6_c set...But the top two from each set cannot be a duplicate in the final 4 values saved. The hierachy is as follows: 1) Always take the first value from advfnl1 and place into "NEWVAR1". 2) The next value comes from advfnl1_c you would place that in 'NEWVAR2' unless it's the same value as 'NEWVAR1'. If it would be the same value as 'NEWVAR1' then use the value that is in advnl2_c and place that value in "NEWVAR2". 3) Place the value of advfnl2 in "NEWVAR3" unless it's the same value as 'NEWVAR1' or 'NEWVAR2'. If it is the same value then use advfnl3. 4) Place the value of advfnl2_c in "NEWVAR4" unless it's the same value as 'NEWVAR1' or 'NEWVAR2' or 'NEWVAR3'. If it is the same value then ues advfnl3_c. Using the example below (and my logic above) the final results would look like: NEWVAR1 NEWVAR2 NEWVAR3 NEWVAR4 34 40 29 49 ID advfnl1 advfnl2 advfnl3 advfnl4 advfnl5 advfnl6 advfnl1_c advfnl2_c advfnl3_c advfnl4_c advfnl5_c advfnl6_c 1234 34 29 43 38 12 54 40 29 34 49 54 22 Let me know if you can assist me in building this array. Thanks.
... View more