Hi!
I am trying to create an organization chart so that each employee is assigned a variable showing the count of people lower than themselves in the hierarchy. For each employee, I have their immediate boss.
This is representative input data:
| EmployeeID of employee | EmployeeID of boss |
| 11 | 100 |
| 3 | 4 |
| 4 | 11 |
| 5 | 11 |
| 6 | 11 |
The output should show the number of people under each person, like this:
| EmployeeID of employee | count |
| 11 | 4 |
| 3 | 0 |
| 4 | 1 |
| 5 | 0 |
| 6 | 0 |
| 100 | 5 |
I feel like I need to loop through the data but not sure where to start. Can you help?