Hi all ,
My data looks like the below (id changed for privacy reasons. I can see the start and end date of investigations or cases. I want to make counts, for given months, of how many cases and investigations one staff person has open (my data has many staff people in it). For exmaple. In month 650, there were 2 investigations and a case opened. However, because the case and investigation before that don't end until month 658 and 650 respecitvely, I want it to count 3 invesitgaitons and 2 cases for month 650. How would I do this? In the end, all I need is by staff and month, how many total investigations and cases they were working on. TY!
My data looks like the below (id changed for privacy reasons. I can see the start and end date of investigations or cases. I want to make counts, for given months, of how many cases and investigations one staff person has open (my data has many staff people in it). For exmaple. In month 650, there were 2 investigations and a case opened. However, because the case and investigation before that don't end until month 658 and 650 respecitvely, I want it to count 3 invesitgaitons and 2 cases for month 650. How would I do this? In the end, all I need is by staff and month, how many total investigations and cases they were working on. TY!
Code:
----------------------- copy starting from the next line -----------------------------------Code:* Example generated by -dataex-. For more info, type help dataex clear input str7 staff_id float(start_date end_date) str8 asgn_cat "K078" 648 658 "CAS" "K078" 649 650 "INV" "K078" 650 651 "INV" "K078" 650 651 "INV" "K078" 650 672 "CAS" "K078" 677 680 "INV" end format %tm start_date format %tm end_date
Comment