2022: Week 52 - Find Sub-Departments from an employee hierarchy (HR Month)
Challenge By: Kelly Gilbert It's the final challenge of HR month already and the final challenge of 2022! Thanks again to Kelly for helping us round out the year with some really interesting real-life challenges. We'll begin 2023 with a beginner month as is tradition, followed by an intermediate month and then our first ever advanced month! Thanks to all who participated this year, we hope you're all having a wonderful festive season. ___________________________ The HRIS (HR information system) keeps track of an employee’s department, but sometimes it is helpful to know the sub-department for reporting and analytics. Inputs Employees: Teams: Requirements Input the data From the employee data, calculate each person’s hierarchy_level The employee_id_hierarchy field contains a person’s supervisory hierarchy flattened into a string (e.g. | CEO’s ID | Vice President’s ID | Director’s ID | Manager’s ID | Employee’s ID |) To calculate the hierarchy level, count the number of ...