Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
Please can someone help me with hierarchy as I am struggling.
I have the following data:
Manager_ID
Manager_Name
Employee_ID
Employee_Name
Manager_ID and Employee_ID are not the original names - it was system_idm (now manager_id) and system_ide (now employee_id), I just renamed these in the load script.
I want the hierarchy to show the employees that are under each manager
Can someone please help me?
Thank you
Data:
Hierarchy(Employee_ID,Manager_ID,Employee_Name,ParentName,Employee_Name,PathName,'-', Depth)
LOAD * Inline [
Employee_ID,Manager_ID,Employee_Name
1, ,Michael Jordan
2,1,LeBron James
3,2,Kareem Abdul Jabbar
4,3,Bill Russell
];
Check here for an example Hierarchy.
Hi BrunPierre,
Thank you. I have tried this but it's not working for me but I'm not sure if that is due to me not understanding it properly.
I have tried this:
Hierarchy(Manager_ID, Employee_ID, Manager_Name, Employee_Name)
LOAD *,
1
Resident EmpTable;
Drop Table EmpTable;
Drop Field "1";
Data:
Hierarchy(Employee_ID,Manager_ID,Employee_Name,ParentName,Employee_Name,PathName,'-', Depth)
LOAD * Inline [
Employee_ID,Manager_ID,Employee_Name
1, ,Michael Jordan
2,1,LeBron James
3,2,Kareem Abdul Jabbar
4,3,Bill Russell
];