I have a data set that contains one first column all the names of the employees and on the second column all the managers.
What I am trying to achieve: Manager columns include multiple hierarchy and I want to split them into multiple columns.
I think the example will better phrase my question. So here we go:
Here is the sample data:
| Employee | Manager |
| Alexis | Cassie |
| Nick | Dave |
| Benjamin | Dave |
| Amanda | Pheobe |
| John | Pheobe |
| Mary | Pheobe |
| Jackie | Pheobe |
| Tom | Justin |
| Dave | Jackson |
| Pheobe | Jackson |
| Justin | Jackson |
| Cassie | Jackson |
| Lex | Jackson |
| Darlene | Lex |
| Daniel | Lex |
And here is the desired output:
| Manager - I | Manager - II | Employee |
| Jackson | Dave | Nick |
| Jackson | Dave | Benjamin |
| Jackson | Pheobe | Amanda |
| Jackson | Pheobe | John |
| Jackson | Pheobe | Mary |
| Jackson | Pheobe | Jackie |
| Jackson | Justin | Tom |
| Jackson | Cassie | Alexis |
| Jackson | Lex | Darlene |
| Jackson | Lex | Daniel |
Any help or suggestion is appreciated. I tried self joining the data, but I kept losing the employees who are not Managers.
Thanks in advance.