Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Link Table (Hierarchy)

Hi all,

Based on a recent post where most of my problems were solved, i am still facing one tiny challange: Hiererchy.

The situation: I have a table of employees. Each employee has a manager. Each manager can have another manager:

EmployeeID
Name
ManagerID
1Smith5
2Miller5
3Gold2
4Stone5
5Boss5

What i need to do is to create a link table in the following format based on the employee table above:

ManagerID
EmployeeID
11
22
32
33
44
51
52
53
54
55

How to read the table above:

- generally every employee is also a manager - even if the peron has no people below, the person is at least his own manager

- each manager must be able to see his own as well as the IDs of the people below. For ManagerID = 3 this means: 2 (the one person below; 3 as himself)

So far so good - but what i am struggeling on is to create the data for a manager that has employees and where one or more of these employees also have employees; like ManagerID = 5. Manager 5 must be able to see all Employee IDs as he is direct manager (for IDs1, 2, 4) and indirect manager (for ID 3).

Hope, my problem became clear. thanks a lot for some hints!

1 Reply
d_pranskus
Partner - Creator III
Partner - Creator III

Hi

Please consider using HIERARCHY function. It automaticaly parses parent-child relations.

Cheers

Darius