Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
New-here1
Contributor III
Contributor III

Hierarchy help

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

 

Labels (3)
1 Solution

Accepted Solutions
BrunPierre
Partner - Master II
Partner - Master II

BrunPierre_0-1666694469093.png

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

];

View solution in original post

3 Replies
BrunPierre
Partner - Master II
Partner - Master II

Check here for an example Hierarchy.

New-here1
Contributor III
Contributor III
Author

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";

BrunPierre
Partner - Master II
Partner - Master II

BrunPierre_0-1666694469093.png

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

];