I have a table below, item A, B, C, D, E are actually the same type but in the "Old_Group" column it was grouped separated by M1, M2, and M3.
Is there a way that can detect their group based on their shared item? In this case, M1 and M3 both have the shared item "A", so even though they have other different items, they can be seen as the same type of items, so they should be group together, and since item G and H don't appear in any other group, they will be assigned in another group. I would expect the result like the column "New_Group".
In the real table, there are much more items, so I'm wondering if there's a faster way to group it correctly, the group number of "New_Group" can assign a random but not duplicated number.
Thank you very much in advance.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…