Hi all,
I have a list of of employees with a unique number assigned to each one.
Then i have a separate list with the entire list of employees and their 1Up manager as well as their 2 Up manager.
I need a script that will look up that employee on the list, finds their 1 UP manager, checks that 1 Up manager to see if the Job Band is A otherwise keep going and look up their managers manager until it finds the person that has a Job Band A and returns that employee ID as well as on a separate column return the employee ID of the manager before him
So basically i am looking to see who the top two managers are.
See below example if we look for Stacey Party the top Manager would be Alex Burn as his Job Band is A and then 2nd top manager is Mike Freespirit
[TABLE="width: 1010"]
<colgroup><col><col><col><col><col><col><col><col><col><col></colgroup><tbody>[TR]
[TD]Employee No[/TD]
[TD]Last Name[/TD]
[TD]First Name[/TD]
[TD]Job Band[/TD]
[TD]1-up employee no.[/TD]
[TD]1-up manager name[/TD]
[TD]2-up employee no.[/TD]
[TD]2-up manager Name[/TD]
[TD]Top Manager[/TD]
[TD]2nd top Manager[/TD]
[/TR]
[TR]
[TD]37975696[/TD]
[TD]Party[/TD]
[TD]Stacy[/TD]
[TD]3i[/TD]
[TD]49114594[/TD]
[TD]John Smith[/TD]
[TD]46741146[/TD]
[TD]Nikita Walter[/TD]
[TD]46740709[/TD]
[TD]37224331[/TD]
[/TR]
[TR]
[TD]49114594[/TD]
[TD]John[/TD]
[TD]Smith[/TD]
[TD]2[/TD]
[TD]46741146[/TD]
[TD]Nikita Walter[/TD]
[TD]37224331[/TD]
[TD]Mike Freeespirit[/TD]
[TD]46740709[/TD]
[TD]37224331[/TD]
[/TR]
[TR]
[TD]46741146[/TD]
[TD]Walter[/TD]
[TD]Nikita[/TD]
[TD]1[/TD]
[TD]37224331[/TD]
[TD]Mike Freeespirit[/TD]
[TD]46740709[/TD]
[TD]Alex Burn[/TD]
[TD]46740709[/TD]
[TD]37224331[/TD]
[/TR]
[TR]
[TD]37224331[/TD]
[TD]Freespirit[/TD]
[TD]Mike[/TD]
[TD]C[/TD]
[TD]46740709[/TD]
[TD]Alex Burn[/TD]
[TD]46516969[/TD]
[TD]Andy Braun[/TD]
[TD]46740709[/TD]
[TD]37224331[/TD]
[/TR]
[TR]
[TD]46740709[/TD]
[TD]Burn[/TD]
[TD]Alex[/TD]
[TD]A[/TD]
[TD]46516969[/TD]
[TD]Andy Braun[/TD]
[TD]0[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
</tbody>[/TABLE]
I have a list of of employees with a unique number assigned to each one.
Then i have a separate list with the entire list of employees and their 1Up manager as well as their 2 Up manager.
I need a script that will look up that employee on the list, finds their 1 UP manager, checks that 1 Up manager to see if the Job Band is A otherwise keep going and look up their managers manager until it finds the person that has a Job Band A and returns that employee ID as well as on a separate column return the employee ID of the manager before him
So basically i am looking to see who the top two managers are.
See below example if we look for Stacey Party the top Manager would be Alex Burn as his Job Band is A and then 2nd top manager is Mike Freespirit
[TABLE="width: 1010"]
<colgroup><col><col><col><col><col><col><col><col><col><col></colgroup><tbody>[TR]
[TD]Employee No[/TD]
[TD]Last Name[/TD]
[TD]First Name[/TD]
[TD]Job Band[/TD]
[TD]1-up employee no.[/TD]
[TD]1-up manager name[/TD]
[TD]2-up employee no.[/TD]
[TD]2-up manager Name[/TD]
[TD]Top Manager[/TD]
[TD]2nd top Manager[/TD]
[/TR]
[TR]
[TD]37975696[/TD]
[TD]Party[/TD]
[TD]Stacy[/TD]
[TD]3i[/TD]
[TD]49114594[/TD]
[TD]John Smith[/TD]
[TD]46741146[/TD]
[TD]Nikita Walter[/TD]
[TD]46740709[/TD]
[TD]37224331[/TD]
[/TR]
[TR]
[TD]49114594[/TD]
[TD]John[/TD]
[TD]Smith[/TD]
[TD]2[/TD]
[TD]46741146[/TD]
[TD]Nikita Walter[/TD]
[TD]37224331[/TD]
[TD]Mike Freeespirit[/TD]
[TD]46740709[/TD]
[TD]37224331[/TD]
[/TR]
[TR]
[TD]46741146[/TD]
[TD]Walter[/TD]
[TD]Nikita[/TD]
[TD]1[/TD]
[TD]37224331[/TD]
[TD]Mike Freeespirit[/TD]
[TD]46740709[/TD]
[TD]Alex Burn[/TD]
[TD]46740709[/TD]
[TD]37224331[/TD]
[/TR]
[TR]
[TD]37224331[/TD]
[TD]Freespirit[/TD]
[TD]Mike[/TD]
[TD]C[/TD]
[TD]46740709[/TD]
[TD]Alex Burn[/TD]
[TD]46516969[/TD]
[TD]Andy Braun[/TD]
[TD]46740709[/TD]
[TD]37224331[/TD]
[/TR]
[TR]
[TD]46740709[/TD]
[TD]Burn[/TD]
[TD]Alex[/TD]
[TD]A[/TD]
[TD]46516969[/TD]
[TD]Andy Braun[/TD]
[TD]0[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
</tbody>[/TABLE]