cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Joining hierarchical data

kiranm
New Contributor II

Hi,
I have an excel with the data in the below format
image

Rows at level 1 is a parent to the next subsequent rows at Level 2.
For ex: Development (row 2) is parent to Java, dotnet, php (rows 3,4,5)
Testing (Row 6)i s parent to Manual, Automation, Load (rows 7, 8, 9)

How can I merge/join each parent (Level 1) to its childs (Level 2)?
Desired output after joining:
Name, Parent
Java, Development
dotnet, Development
php, Development
Manual, Testing
Automation, Testing
โ€ฆ

Excel attached for referencehierarchy.xlsx (10.8 KB)

1 ACCEPTED SOLUTION

koryknick
Employee
Employee

Attached is a pipeline that should do this a little more generically, using a Script snap as Anubhav has suggested may be necessary. The script snap is necessary, mainly because SnapLogic works on data documents and does not hold any context between. The Script snap provides a way to process the entire stream and is able to maintain that context from one document to the next.

I hope this helps solve your problem!

Example_Flatten_Hierarchy_Data_2020_06_29.slp (7.6 KB)

View solution in original post

5 REPLIES 5

kiranm
New Contributor II

Hi Koryknick,

Thank you for the pipeline with the script.
This is working and exactly what I need.
Now I know when to you the Script snap ๐Ÿ™‚