Hi,
I am looking for a code that returns the count / frequency of transactions where any two or more items are sold together for eg.
[TABLE="class: grid, width: 280"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD="align: center"]Transaction No.[/TD]
[TD="align: center"]Item[/TD]
[/TR]
[TR]
[TD="align: center"]10020[/TD]
[TD="align: center"]apple[/TD]
[/TR]
[TR]
[TD="align: center"]10021[/TD]
[TD="align: center"]apple[/TD]
[/TR]
[TR]
[TD="align: center"]10021[/TD]
[TD="align: center"]banana[/TD]
[/TR]
[TR]
[TD="align: center"]10021[/TD]
[TD="align: center"]carrot[/TD]
[/TR]
[TR]
[TD="align: center"]10022[/TD]
[TD="align: center"]apple[/TD]
[/TR]
[TR]
[TD="align: center"]10022[/TD]
[TD="align: center"]banana[/TD]
[/TR]
[TR]
[TD="align: center"]10023[/TD]
[TD="align: center"]lemon[/TD]
[/TR]
[TR]
[TD="align: center"]10024[/TD]
[TD="align: center"]kiwi[/TD]
[/TR]
[TR]
[TD="align: center"]10025[/TD]
[TD="align: center"]orange[/TD]
[/TR]
[TR]
[TD="align: center"]10026[/TD]
[TD="align: center"]carrot[/TD]
[/TR]
[TR]
[TD="align: center"]10026[/TD]
[TD="align: center"]banana[/TD]
[/TR]
[TR]
[TD="align: center"]10026[/TD]
[TD="align: center"]apple[/TD]
[/TR]
</tbody>[/TABLE]
DESIRED RESULT:
[TABLE="class: grid, width: 248"]
<colgroup><col style="text-align: center;"><col style="text-align: center;"></colgroup><tbody>[TR]
[TD="align: center"]Combination[/TD]
[TD="align: center"]Frequency[/TD]
[/TR]
[TR]
[TD="align: center"]apple, banana[/TD]
[TD="align: center"]2[/TD]
[/TR]
[TR]
[TD="align: center"]apple, carrot[/TD]
[TD="align: center"]2[/TD]
[/TR]
[TR]
[TD="align: center"]apple, carrot, banana[/TD]
[TD="align: center"]2[/TD]
[/TR]
[TR]
[TD="align: center"]banana, carrot[/TD]
[TD="align: center"]2[/TD]
[/TR]
[TR]
[TD="align: center"]lemon[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]orange[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]kiwi[/TD]
[TD="align: center"]1[/TD]
[/TR]
</tbody>[/TABLE]
Thanks
I am looking for a code that returns the count / frequency of transactions where any two or more items are sold together for eg.
[TABLE="class: grid, width: 280"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD="align: center"]Transaction No.[/TD]
[TD="align: center"]Item[/TD]
[/TR]
[TR]
[TD="align: center"]10020[/TD]
[TD="align: center"]apple[/TD]
[/TR]
[TR]
[TD="align: center"]10021[/TD]
[TD="align: center"]apple[/TD]
[/TR]
[TR]
[TD="align: center"]10021[/TD]
[TD="align: center"]banana[/TD]
[/TR]
[TR]
[TD="align: center"]10021[/TD]
[TD="align: center"]carrot[/TD]
[/TR]
[TR]
[TD="align: center"]10022[/TD]
[TD="align: center"]apple[/TD]
[/TR]
[TR]
[TD="align: center"]10022[/TD]
[TD="align: center"]banana[/TD]
[/TR]
[TR]
[TD="align: center"]10023[/TD]
[TD="align: center"]lemon[/TD]
[/TR]
[TR]
[TD="align: center"]10024[/TD]
[TD="align: center"]kiwi[/TD]
[/TR]
[TR]
[TD="align: center"]10025[/TD]
[TD="align: center"]orange[/TD]
[/TR]
[TR]
[TD="align: center"]10026[/TD]
[TD="align: center"]carrot[/TD]
[/TR]
[TR]
[TD="align: center"]10026[/TD]
[TD="align: center"]banana[/TD]
[/TR]
[TR]
[TD="align: center"]10026[/TD]
[TD="align: center"]apple[/TD]
[/TR]
</tbody>[/TABLE]
DESIRED RESULT:
[TABLE="class: grid, width: 248"]
<colgroup><col style="text-align: center;"><col style="text-align: center;"></colgroup><tbody>[TR]
[TD="align: center"]Combination[/TD]
[TD="align: center"]Frequency[/TD]
[/TR]
[TR]
[TD="align: center"]apple, banana[/TD]
[TD="align: center"]2[/TD]
[/TR]
[TR]
[TD="align: center"]apple, carrot[/TD]
[TD="align: center"]2[/TD]
[/TR]
[TR]
[TD="align: center"]apple, carrot, banana[/TD]
[TD="align: center"]2[/TD]
[/TR]
[TR]
[TD="align: center"]banana, carrot[/TD]
[TD="align: center"]2[/TD]
[/TR]
[TR]
[TD="align: center"]lemon[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]orange[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]kiwi[/TD]
[TD="align: center"]1[/TD]
[/TR]
</tbody>[/TABLE]
Thanks