I have found several threads creating all combinations of pairs within a list. I am having trouble with inserting an additional field to consider if the numbers are eligible to be paired.
First column is a list of work orders (many instances). The second column is a list of items issued to that work order. I am trying to create a 2 column solution with every combination of items issued to the same work order.
[TABLE="width: 149"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD]Work Order [/TD]
[TD]Item [/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]a[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]b[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]c[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]d[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]e[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]f
[/TD]
[/TR]
</tbody>[/TABLE]
Output would look something like this (2 columns or deliminator):
a b
a c
b c
d e
d f
e f
a, b and c were only paired because they shared a common WO. d,e, and f shared a WO also.
Real world application - trying to identify items often issued together (to the same WO) in order to rearrange warehouse to put items closer to each other. The more combinations of a/b the more likely they will be stored together.,
First column is a list of work orders (many instances). The second column is a list of items issued to that work order. I am trying to create a 2 column solution with every combination of items issued to the same work order.
[TABLE="width: 149"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD]Work Order [/TD]
[TD]Item [/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]a[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]b[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]c[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]d[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]e[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]f
[/TD]
[/TR]
</tbody>[/TABLE]
Output would look something like this (2 columns or deliminator):
a b
a c
b c
d e
d f
e f
a, b and c were only paired because they shared a common WO. d,e, and f shared a WO also.
Real world application - trying to identify items often issued together (to the same WO) in order to rearrange warehouse to put items closer to each other. The more combinations of a/b the more likely they will be stored together.,