Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello! How i can decode Last Name from field 'Reports to' if used 'EmpID'?
For value 4 from 'Reports To' I show for Last Name - Callins
Question is not clear? What is the outcome
Hi @andreevaa,
You can try using Mapping. See below...
Table:
load * inline [
EmpID, LastName, ReportsTo,
24,Crawford,19
1,Roll,4,
2,Presley,,
3,Carsson,4,
9,Brolin,4,
42,Arlig,3,
52,Ashkenaz,42,
7,Lindwall,4,
8,Shine,2,
19,Lawson,8,
23,Sandu,19,
43,Park,7,
44,Kent,7,
4,Callins,2
];
MapLastName:
Mapping Load
EmpID,
LastName
Resident Table;
Decode:
Load
EmpID,LastName,ReportsTo,
ApplyMap('MapLastName',ReportsTo,Null()) as ReportsToLastName
Resident Table;
Drop table Table;
Regards,
Ezir