I have a dataset as below. There are two columns, one is the team ID, the other is the team member ID. I want to create a column to represent the team size. In other words, the number of unique member ID in each team. Does anyone know how to do it?
What I would like to have is:
Code:
cls clear all input team member 1 1 1 1 1 1 1 2 1 2 1 2 1 3 1 3 1 3 1 4 1 4 1 4 2 5 2 5 2 6 2 6 2 6 2 7 3 9 3 9 3 10 3 10 end
Code:
input team member size 1 1 4 1 1 4 1 1 4 1 2 4 1 2 4 1 2 4 1 3 4 1 3 4 1 3 4 1 4 4 1 4 4 1 4 4 2 5 3 2 5 3 2 6 3 2 6 3 2 6 3 2 7 3 3 9 2 3 9 2 3 10 2 3 10 2 end
Comment