How to get other matched value in a separate column in a Datatable? Please Help

Please help me to solve this.
In a datatable, I need to get the matched value in a separate column (copy to a new datatable).

What I have:
image
What I need:
image
Since dealing with datatable with large data, I am trying in LinQ Query instead of For Each loop:

Please help me

Hi @GuhanTM

Maybe below steps can get what you need.
1.Use your data table left join itself by Column2 = Column2 and Column1 != Column1.
2.Remove the extra Column2.
JoinDataTable.xaml (9.6 KB)

1 Like

@GuhanTM
find attached demo xaml:
SelfJoin_1Col.xaml (7.9 KB)
grafik

grafik
Have a look on following to track the nature of Join:
F 300 does not find a join pair, so it is ommited
A 100 can also join with itself, so it was necessaire to filter out d1(0) = d2(0)
the 200 group with 3 members is joining all members so pairs are found for #1-#2, #1-#3

Let us know your feedback

1 Like

Thanks for the reply @wusiyangjia and it is working and I need it in Linq query

@ppr Thank you for the reply and it is working exactly as expected.
Thanks again.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.