I have requirement where I am trying to get the count of employees based on different department and different dates.
So twist is that the same employee is working with two different groups and I need to get the count for him in both the group (number of days worked)
| Emp_id | Dept | Date | Location |
| 879362 | FCD | 19/10/2023 | Mumbai |
| 879362 | FCD | 20/10/2023 | Mumbai |
| 879362 | CTO | 21/10/2023 | Mumbai |
| 879362 | CTO | 23/10/2023 | Mumbai |
| 879362 | CTO | 22/10/2023 | Mumbai |
| 626866 | MAP | 19/10/2023 | Mumbai |
So as you see I have shown the occurance of the employee 879362 is appearing for two different group and I need a count of his occurance and the output should show only maximum occurrence value.
Expected output would be like
| Emp_id | Dept | Count | Location |
| 879362 | CTO | 3 | Mumbai |
| 626866 | MAP | 1 | Mumbai |
It would be grateful of you if some share the snapshot with logic because I don't have laptop with me as of now.
Summarize on all the columns and add a count. Sort it by empid and count and a unique tool to remove any duplicated employee ids.