Hello I need your appreciated assistance in the below case I have a data set includes three columns Customer ID , Existing Account and New Account , the existing account could be replaced with the new account and the new account will open a new record to be a existing account , and the account may be replaced many times . Like below Data have ;
input Cust_ID $3. Exist_Account $3. New_Account $4.;
datalines;
003 CA CB
002 BB BC
002 BC
001 AA AB
003 DC DD
001 AC AD
001 AD AE
003 CB CC
003 DD
003 DB DC
003 DA DB
002 BA BB
001 AE
001 AB AC
003 CC
;
Run ; for example : Existing Account "AA" replaced by new account "AB" and "AB" opened a new record to be existing account then "AB" Replaced by "AC" and "AC" opened a new record to be existing account then "AC" Replaced by "AD" and "AD" opened a new record to be existing account then "AD" Replaced by "AE" and "AE" opened a new record to be existing account . Cust_ID Exist_Account New_Account 003 CA CB 002 BB BC 002 BC 001 AA AB 003 DC DD 001 AC AD 001 AD AE 003 CB CC 003 DD 003 DB DC 003 DA DB 002 BA BB 001 AE 001 AB AC 003 CC the results should be like the below: Cust_ID First_Account Last_Account Replacement_Count 001 AA AE 4 002 BA BC 2 003 CA CC 2 003 DA DD 3 Thank you ...
... View more