I have 2 excel files and I am fetching some data using Excel as db storing data in a data table variable (dt1, dt2). Both dt variables have a column containing dates. I want to filter the dates which are present in dt1 and not present in dt2.
What is the effective way to achieve this.
Note:
Column name will be different in both the dt variables
Both will be stored virtually in dt variable and not in an excel file.
Use this in assign activity to get the unmatched records based on comparing one specific column
Out_NonMatched_Data = In_DataTable1.AsEnumerable().Where(function(row) Not In_DataTable2.AsEnumerable().Select(function(r) r(In_DT2_ColName_To_Match.ToString)).Any(function(x) x = row(In_DT1_ColName_To_Match.ToString))).CopyToDataTable()
Compare “Column1” from dt1 with “Column2” from dt2 and get the matching rows.
matchingRows = from row1 in dt1.AsEnumerable()
join row2 in dt2.AsEnumerable()
on row1.Field<string>("Column1") equals row2.Field<string>("Column2")
elect row1;
Convert the matching rows to a new DataTable if needed.