Requirement-
Required maximum count of days that employee worked in that business for that specific month
Emp Id | Business group | Start date | Month |
123 | ABC | 10/1/2023 | 2023-Oct |
123 | ABC | 10/2/2023 | 2023-Oct |
123 | DEF | 10/3/2023 | 2023-Oct |
123 | DEF | 10/4/2023 | 2023-Oct |
123 | DEF | 10/5/2023 | 2023-Oct |
234 | ABC | 10/1/2023 | 2023-Oct |
234 | ABC | 10/2/2023 | 2023-Oct |
234 | DEF | 10/3/2023 | 2023-Oct |
456 | DEF | 10/1/2023 | 2023-Oct |
456 | DEF | 10/2/2023 | 2023-Oct |
123 | ABC | 9/1/2023 | 2023-Sep |
123 | ABC | 9/2/2023 | 2023-Sep |
123 | DEF | 8/3/2023 | 2023-Aug |
123 | DEF | 8/4/2023 | 2023-Aug |
123 | DEF | 8/5/2023 | 2023-Aug |
234 | ABC | 9/1/2023 | 2023-Sep |
234 | ABC | 9/2/2023 | 2023-Sep |
234 | DEF | 9/3/2023 | 2023-Sep |
456 | DEF | 8/1/2023 | 2023-Aug |
456 | DEF | 8/2/2023 | 2023-Aug |
Output required:
Please note- Output of maximum days should not be greater than 31 days of an employee
Emp Id | Business group | Start date | Month | Count of days worked in month for that business group | Main output as Max count days ( Employee worked more in which business for that month) |
123 | ABC | 10/1/2023 | 23-Oct | 2 | |
123 | ABC | 10/2/2023 | 23-Oct | 2 | |
123 | DEF | 10/3/2023 | 23-Oct | 3 | 3 |
123 | DEF | 10/4/2023 | 23-Oct | 3 | |
123 | DEF | 10/5/2023 | 23-Oct | 3 | |
234 | ABC | 10/1/2023 | 23-Oct | 2 | 2 |
234 | ABC | 10/2/2023 | 23-Oct | 2 | |
234 | DEF | 10/3/2023 | 23-Oct | 1 | |
456 | DEF | 10/1/2023 | 23-Oct | 2 | 2 |
456 | DEF | 10/2/2023 | 23-Oct | 2 | |
123 | ABC | 9/1/2023 | 23-Sep | 2 | 2 |
123 | ABC | 9/2/2023 | 23-Sep | 2 | |
123 | DEF | 8/3/2023 | 23-Aug | 3 | 3 |
123 | DEF | 8/4/2023 | 23-Aug | 3 | |
123 | DEF | 8/5/2023 | 23-Aug | 3 | |
234 | ABC | 9/1/2023 | 23-Sep | 2 | 2 |
234 | ABC | 9/2/2023 | 23-Sep | 2 | |
234 | DEF | 9/3/2023 | 23-Sep | 1 | |
456 | DEF | 8/1/2023 | 23-Aug | 2 | 2 |
456 | DEF | 8/2/2023 | 23-Aug | 2 |
@DeepikaK What is the logic to calculate the fields Count of days worked in month and max days?
logic is based on employee worked in the number of business group.
Hi