
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks bro for the help it really kind of you


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
is this what you are looking for? (i changed the field names Parent to supervisor and child to Employee for my understanding).
(i see you want all the non metric fields like BOM Level 1 Code, BOM Level 1 Name, BOM Level 1 Item Group Code etc which i havent written code for the thoses joins yet, this code being a tedious n laborious)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi @Qrishna thanks but i look for like that
looking for Parent child relation every id wise
ParentItemID | L1 | L2 | L3 | L4 |
1001 | 1002 | |||
1001 | 1003 | 1004 | ||
1001 | 1003 | 1005 | 1006 | |
1001 | 1003 | 1005 | 1007 | 1008 |
1003 | 1004 | |||
1003 | 1005 | 1006 | ||
1003 | 1005 | 1007 | 1008 | |
1005 | 1006 | |||
1005 | 1007 | 1008 | ||
1007 | 1008 |


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please try below:
//---------------------------------------------------//
//----------Update----------//
// 2. Find the Total Quantity for each pathname - Objective2
// 2.1. Split the PathName into individual employee IDs.
PathExploded:
LOAD distinct
PathName,
SubField(PathName, '\') AS Employee
RESIDENT Heirarchy;
// 2.2 Join the quantities to each employee in the path.
LEFT JOIN (PathExploded)
LOAD
employee as Employee,
Qty
RESIDENT Employee;
// 2.3. Aggregate to calculate the total quantity for each path.
left join(Heirarchy)
TotalPathQty:
Load *, SubField(PathName, '\', -1) AS MemberID;
LOAD
PathName,
SUM(Qty) AS TotalQty
RESIDENT PathExploded
GROUP BY PathName
order by PathName;
// Drop the intermediate exploded table if no longer needed.
DROP TABLE PathExploded;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks @Qrishna how about total quantity at lowest level


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Will post the script soon for that, as you changed the requirement from that of the original post in you reply, i had to rewrite the entire code and forgot about TotalQty. in the mean time, post the expected Totalqty column values in your table, that would be helpful.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have attached the file which have requirements


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I just updated the code with the Objective2 - TotalQty.
Good luck with your Assignment.!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks bro for the help it really kind of you


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No Worries, please close the thread marking the right solution.
