I need to merge 2 different table based on one particular column - GEID . The 2 excel table is given below
Table 1:
Table 2:
If you could observe the order of rows are different when you try to match with “GEID” column apart from Row 1 . I use “Join Data Tables” to merge table to get expected output
But output I received was something like this
What i found was only first row is merged remain all rows are not merged but added as new row, since I used “Full” join type.
Could you please suggest how can i join when row order is different
we do face some outputs in case of the values from join columns are not matching. Escpecially when data comes from Excel a space on the end can provoke such output.
We would recommend to have a quick check in excel if this is the case e.g. for the second row (not doing the matching) and to implement some cleansing on the data.
In case of only the result of inner join is needed we can also do it with a LINQ already implementing such trimin / cleansing.
Thanks for all your responses. @Hiba_B - I tried inner join that also didn’t work. @saijagadesh06 - Thanks for sharing the code snippet
Comment given by @postwick is right, merge will just concatenate, so always row 1 - row 1 comparison it will do.
I resolved it by a simple logic - Sort both DT using “GEID” then merge
asc or desc in any order, both DT will have GEID in same order then merge is possible.
Another important point as part of my learning, “GEID” in both excel should be in same format - “General” or “Text” (Prefer - Text)