Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Community
Employee No | Name | Reports To | Required Result |
1111 | AAAAAA | DDDDDDD | 2000 |
1112 | BBBBBBB | DDDDDDD | 2000 |
1113 | CCCCCC | DDDDDDD | 2000 |
I am making Hierarchy. I have Employee No, Name and Reports To. The Reports To is causing problem in creating the Hierarchy since it is not having Employee Code, it has Employee Name.
So, what i want where ever "Reports To" Employee Name is coming there i Want to Show "Reports To" Employee ID from the Script.
The Desired Output,I have shown in above chart.
Regards
Aviral
Are you trying to make a table that shows all this information? and you're asking how to write a statement to show the ID of who the employee reports to?
Try just using set analysis. The condition would be the name of the person reported to
Hi Robert
Thanks for the reply. But I don't want to use Set Analysis as i said that i want Reports To Employee ID from script using if condition. Is there a workaround.
Hierarchy:
Hierarchy ([Employee No], [Reports To], [Name], [Manager Name], [Name], Hierarchy, '/')
LOAD
[Employee No],
[Reports To], // This is causing problem since it's a name and i want Employee Code instead of Name
[Employee Name] as Name
RESIDENT Employee;
How is your data set up that you're importing? Would it be possible to use a join?
Hierarchy ([Employee No], [Reports To], [Name], [Manager Name], [Name], Hierarchy, '/')
LOAD
[Employee No],
[Reports To], // This is causing problem since it's a name and i want Employee Code instead of Name
[Employee Name] as Name
RESIDENT Employee;
Hi, Neg.
Try this:
MAP_Name2Code:
Mapping LOAD
[Employee Name],
[Employee No]
RESIDENT Employee;
Hierarchy ([Employee No], [Reports To], [Name], [Manager Name], [Name], Hierarchy, '/')
LOAD
[Employee No],
ApplyMap('MAP_Name2Code', [Reports To]) as [Reports To],
[Employee Name] as Name
RESIDENT Employee;
First we create a map name to code and then apply that map to get the code instead of the name in the Hierarchy. Hope is helps.
Regards.