I'm trying to do a custom sort with an indented bill of materials and figured I reach out and see if anyone has done something like this already.
I have an existing dataset with an indented BOM formatted like this example:
Assy Part | Level | Component | Item number | Assembly |
1000-01 | .1 | 1000-21 | 001 | Y |
1000-01 | .1 | 100-234 | 002 | Y |
1000-01 | .1 | ABC-56 | 003 | |
1000-01 | .1 | ABC-2 | 004 | |
1000-01 | .1 | XYZ.001 | 005 | |
100-234 | ..2 | 22-2424 | 001 | |
100-234 | ..2 | XYZ.001 | 002 | |
100-234 | ..2 | 100-345 | 003 |
I would like to re-sort this by indenting the assembly like this:
Assy Part | Level | Component | Item number | Assembly |
1000-01 | .1 | 1000-21 | 001 | Y |
1000-01 | .1 | 100-234 | 002 | Y |
100-234 | ..2 | 22-2424 | 001 | |
100-234 | ..2 | XYZ.001 | 002 | |
100-234 | ..2 | 100-345 | 003 | |
1000-01 | .1 | ABC-56 | 003 | |
1000-01 | .1 | ABC-2 | 004 | |
1000-01 | .1 | XYZ.001 | 005 |
Note that this could be further compounded because there could be another assembly under the 100-234 part.
Hi @michstr,
I am afraid we will need more detail to be really helpful, or more data samples but at face value if you want the table to look the way you have it on the bottom you can accomplish this with just a sort tool
Looking forward to helping you more,
Regards
Thanks. I'll try to come up with a more detailed example to help.
I've added some additional complexity to my example. I don't think this can be accomplished with a sort.
Existing | |||
Assy Part | Level | Component | Item number |
1000-01 | .1 | 1000-21 | 001 |
1000-01 | .1 | ABC-56 | 002 |
1000-01 | .1 | 100-234 | 003 |
1000-01 | .1 | ABC-2 | 004 |
1000-01 | .1 | XYZ.001 | 005 |
100-234 | ..2 | 22-2424 | 001 |
100-234 | ..2 | XYZ.001 | 002 |
100-234 | ..2 | 100-345 | 003 |
100-345 | …3 | 100-346 | 001 |
100-345 | …3 | 100-348 | 002 |
100-345 | …3 | 100-360 | 003 |
Desired | |||
Assy Part | Level | Component | Item number |
1000-01 | .1 | 1000-21 | 001 |
1000-01 | .1 | ABC-56 | 002 |
1000-01 | .1 | 100-234 | 003 |
100-234 | ..2 | 22-2424 | 001 |
100-234 | ..2 | XYZ.001 | 002 |
100-234 | ..2 | 100-345 | 003 |
100-345 | …3 | 100-346 | 001 |
100-345 | …3 | 100-348 | 002 |
100-345 | …3 | 100-360 | 003 |
1000-01 | .1 | ABC-2 | 004 |
1000-01 | .1 | XYZ.001 | 005 |