My data structure is like this ID TYPE A K1 A K2 A K3 B K3 C K2 C K3 D K2 I want to match, for each unique ID, how many other unique ID's that have the same type. For example, the output for this data would be ID NUMBEROFID A 3 (A contains K1,K2,K3. Nobody else is K1 so we don't need to consider K1. Because there are C and D,except A, that are K2. There are B and C,except A, that are K3 => the unique members, hence, are=> B C D, return 3 ) B 2 (Because B has only one type K3, so the only member that has K3 except B are => A and C. So return 2 ) C 2 (C contains K2 and K3. The member that has K2, except C, are A,D. The member that has K3, except C, are A,B => Member are A,B,D, return 3) D 2 (Same reasoning => A,C, return 2) Please help! Thank you in Advance
... View more