Hi Guys,
I am working with a hierarchy. I flattened it so that columns 1-11 in the example below represent the hierarchy path depth for each item. Below is a small sample of the data (for the first item with ID 188- parent is item 186, grand- parent item 6, etc)
I am stuck with being able to identify the shortest depth per Some Grouping Column. Column 'Min Length' is what I need to get. Would you be able to help?
SOME GROUPING | Item ID | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Min Length |
A | 188 | 1 | 6 | 186 | 188 | 3 | |||||||
A | 23 | 1 | 6 | 23 | 3 | ||||||||
A | 263 | 1 | 6 | 260 | 263 | 3 | |||||||
A | 921 | 1 | 6 | 447 | 916 | 917 | 918 | 920 | 921 | 3 | |||
A | 266 | 1 | 6 | 260 | 265 | 266 | 3 | ||||||
A | 919 | 1 | 6 | 447 | 916 | 917 | 918 | 919 | 3 | ||||
A | 1025 | 1 | 6 | 447 | 1,024 | 1,025 | 3 | ||||||
A | 165 | 1 | 6 | 23 | 74 | 164 | 165 | 3 | |||||
A | 1004 | 1 | 6 | 447 | 916 | 917 | 918 | 1,003 | 1,004 | 3 | |||
A | 488 | 1 | 6 | 447 | 448 | 3 | |||||||
B | 494 | 1 | 6 | 447 | 450 | 489 | 490 | 493 | 494 | 8 | |||
B | 964 | 1 | 6 | 447 | 916 | 917 | 918 | 946 | 958 | 961 | 963 | 964 | 8 |
B | 926 | 1 | 6 | 447 | 916 | 917 | 918 | 946 | 926 | 8 | |||
C | 756 | 1 | 6 | 447 | 525 | 528 | 737 | 756 | 7 | ||||
D | 304 | 1 | 6 | 280 | 301 | 302 | 303 | 304 | 5 | ||||
D | 284 | 1 | 6 | 280 | 282 | 284 | 5 | ||||||
D | 319 | 1 | 6 | 280 | 301 | 302 | 314 | 318 | 319 | 5 |
Thank you!
Solved! Go to Solution.
@OJet
Hope this is what you need.
Thank you so much, exactly what I needed!
@OJet
Glad to help and thank you for the accept mark also