Hi. I have medical appointment data along with doctor details from January 2022 to July 2024. The doctor details include the date of the doctors joining the hospital and the date of them leaving. For each day between Jan 2022 - July 2024 (each day in my data), I am trying to find the number of "active" doctors. That is, the total number of working doctors, which includes those who've joined and subtracts those who've left. This would include:
1. the total number of working doctors on Jan 1, 2022 = number of who joined before Jan 1, 2022
2. the total number of working doctors on June 30, 2022 = the total number of working doctors on Jan 1, 2022 + any doctors who've joined before June 2022 - any doctors who've left before June 2022.
Any help in doing this will be much appreciated!
1. the total number of working doctors on Jan 1, 2022 = number of who joined before Jan 1, 2022
2. the total number of working doctors on June 30, 2022 = the total number of working doctors on Jan 1, 2022 + any doctors who've joined before June 2022 - any doctors who've left before June 2022.
Any help in doing this will be much appreciated!
Code:
clear input float appt_date str37 consultant int(doc_entryDate doc_RelievingDate) 22646 "Jenil Nilesh Sheth" 21581 22795 22646 "B Maneesha Mohan" 22128 22863 22646 "Niroj Kumar Sahoo" 22128 . 22646 "Niroj Kumar Sahoo" 22128 . 22646 "Jenil Nilesh Sheth" 21581 22795 22646 "Niroj Kumar Sahoo" 22128 . 22646 "Mudit Tyagi" 19267 . 22646 "Sujata Das" 17198 . 22646 "Jenil Nilesh Sheth" 21581 22795 22646 "Jenil Nilesh Sheth" 21581 22795 22646 "Anasua Kapoor" 20301 . 22646 "Niroj Kumar Sahoo" 22128 . 22646 "Anasua Kapoor" 20301 . 22646 "Mudit Tyagi" 19267 . 22646 "Niroj Kumar Sahoo" 22128 . 22646 "Sujata Das" 17198 . 22646 "Sujata Das" 17198 . 22646 "Sujata Das" 17198 . 22646 "Jenil Nilesh Sheth" 21581 22795 22646 "Sujata Das" 17198 . 22646 "B Maneesha Mohan" 22128 22863 22646 "Anasua Kapoor" 20301 . 22646 "Jenil Nilesh Sheth" 21581 22795 22646 "Niroj Kumar Sahoo" 22128 . 22646 "Jenil Nilesh Sheth" 21581 22795 22646 "Jenil Nilesh Sheth" 21581 22795 22646 "Anasua Kapoor" 20301 . 22646 "B Maneesha Mohan" 22128 22863 22646 "Niroj Kumar Sahoo" 22128 . 22646 "Anasua Kapoor" 20301 . 22646 "Jenil Nilesh Sheth" 21581 22795 22646 "B Maneesha Mohan" 22128 22863 22646 "B Maneesha Mohan" 22128 22863 22646 "Anasua Kapoor" 20301 . 22646 "Jenil Nilesh Sheth" 21581 22795 22646 "Anasua Kapoor" 20301 . 22646 "Jenil Nilesh Sheth" 21581 22795 22646 "Jenil Nilesh Sheth" 21581 22795 22646 "Jenil Nilesh Sheth" 21581 22795 22646 "Sujata Das" 17198 . 22646 "Tarjani Dave" 19769 . 22646 "Anasua Kapoor" 20301 . 22646 "Sujata Das" 17198 . 22646 "Sujata Das" 17198 . 22646 "Sujata Das" 17198 . 22646 "Mudit Tyagi" 19267 . 22646 "Anasua Kapoor" 20301 . 22646 "Anasua Kapoor" 20301 . 22646 "Sunita Chaurasia" 17624 . 22646 "B Maneesha Mohan" 22128 22863 22646 "Sunita Chaurasia" 17624 . 22646 "Jenil Nilesh Sheth" 21581 22795 22646 "Niroj Kumar Sahoo" 22128 . 22646 "B Maneesha Mohan" 22128 22863 22646 "Mudit Tyagi" 19267 . 22646 "Sujata Das" 17198 . 22646 "Jenil Nilesh Sheth" 21581 22795 22646 "Mudit Tyagi" 19267 . 22646 "Sujata Das" 17198 . 22646 "Niroj Kumar Sahoo" 22128 . 22646 "Anasua Kapoor" 20301 . 22646 "Anasua Kapoor" 20301 . 22646 "Sujata Das" 17198 . 22646 "Jenil Nilesh Sheth" 21581 22795 22646 "Jenil Nilesh Sheth" 21581 22795 22646 "Jenil Nilesh Sheth" 21581 22795 22646 "Anasua Kapoor" 20301 . 22646 "Jenil Nilesh Sheth" 21581 22795 22646 "Anasua Kapoor" 20301 . 22646 "Mudit Tyagi" 19267 . 22646 "Anasua Kapoor" 20301 . 22646 "Anasua Kapoor" 20301 . 22646 "Mudit Tyagi" 19267 . 22646 "Niroj Kumar Sahoo" 22128 . 22646 "B Maneesha Mohan" 22128 22863 22646 "Anasua Kapoor" 20301 . 22646 "Tarjani Dave" 19769 . 22648 "Mukesh Jain" 21705 23010 22648 "Debasmita Majhi" 20835 . 22648 "Debasmita Majhi" 20835 . 22648 "Sameera Nayak" 19632 . 22648 "Vivek Pravin Dave" 19769 . 22648 "Sameera Nayak" 19632 . 22648 "Debasmita Majhi" 20835 . 22648 "Sameera Nayak" 19632 . 22648 "Soumyava Basu" 16603 . 22648 "Anamika Patel" 22097 23130 22648 "Sameera Nayak" 19632 . 22648 "Pragnya Rao Donthineni" 21381 . 22648 "Muraleedhara Ramappa" 17272 . 22648 "Sameera Nayak" 19632 . 22648 "Vivek Pravin Dave" 19769 . 22648 "Sameera Nayak" 19632 . end format %td appt_date format %tdnn/dd/CCYY doc_entryDate format %tdnn/dd/CCYY doc_RelievingDate
Comment