Hello,
A PhD student posting for the first time here. I'm having a problem with creating a sequence number for ID-data pairs within each ID. Please see the following illustration.
I want to create Semester # for each student. For example, student with ID = 1 studied two semesters: 88 and 99, so I want to mark pairs (1,88) and (1,99) as his first and second semester, respectively. Same goes for other students.
Although I understand that I can use levelsof ID and create loops, it doesn't seem like a good way to do it. Is there any better way to do this? Thank you very much.
Best regards,
Don Tawanpitak
A PhD student posting for the first time here. I'm having a problem with creating a sequence number for ID-data pairs within each ID. Please see the following illustration.
ID | Semester Code | Course | Semester # |
1 | 88 | A | 1 |
1 | 88 | B | 1 |
1 | 99 | C | 2 |
2 | 77 | D | 1 |
2 | 88 | A | 2 |
2 | 88 | E | 2 |
2 | 99 | F | 3 |
3 | 77 | D | 1 |
3 | 88 | G | 2 |
Although I understand that I can use levelsof ID and create loops, it doesn't seem like a good way to do it. Is there any better way to do this? Thank you very much.
Best regards,
Don Tawanpitak
Comment