I have an AndMode listbox with Products. Each product is made up of a number of parts. When a product is selected in the AndMode listbox, I have an expression that shows the number of common parts between the selected product and the rest of the products.
P1 A, B, C, D, E
P2 A, F, G, H
P3 C, E, F, I
P4 A, B, E, G, J
P5 C, E, F, G, H
When P1 is selected, the following is seen:
P2 1 (since P2 shares 1 common part with the selected Product P1)
P3 2 (since P3 shares 2 common parts with the selected Product P1)
P4 3 (since P4 shares 3 common parts with the selected Product P1)
P5 2 (since P5 shares 2 common parts with the selected Product P1)
So when P1 is selected, it can be seen that P4 has the highest number of shared parts with P1 than the other products.
I want to find a way to show each product's most common product.
For example, the table would look like the following without having to manually select each product individually:
Product Most Similar to
Is there a way to aggregate through selections and list out the most common product for each selected product?