I have a dataset
case_id subcase_id
1 | 1-1
1 | 1-2
1 | 1-3
1 | 1-6
2 | 2-1
2 | 2-7
I want the following output. The idea is to count the occurence of a subcase corresponding to a case.
case_id subcase_id
1 | 1-1 | 1
1 | 1-2 | 2
1 | 1-3 | 3
1 | 1-6 | 4
2 | 2-1 | 1
2 | 2-7 | 2
subcase_idalways map to thecase_id? Can the trailing number in thesubcase_idextend into two or more digits? Does it matter what order the count is in?