Compare two excel and write the result in particular column

Excel 1

Excel 2

Want the result like this

Actually I want to compare the two excel
and write the particular column only in Result excel

Hi @krishna_priya2 - Can you explain what are the columns you want to compare, and does the result column has to write in a separate excel or one of the two input excels

@krishna_priya2

Follow the steps

  1. Read both the excels into datatable dt1 and dt2
  2. Now use join activity and join on vendor_no using inner join
  3. Use filter datatable and go to filter wizard columns tab and mention the columns you need
  4. Use add data column activity and add result column
  5. Use dt.Columns("result").Expression = "’Confirmed’"

Cheers

Hi @krishna_priya2 - Please check the below workflow

SampleWorkflow.zip
(24.4 KB)

  • Read two input excels and store the data in a data table (DT1, DT2)
  • Take assign activity to compare the rows
Variable of type data table DT3 = DT1.AsEnumerable().Intersect(Dt2.AsEnumerable(),System.Data.DataRowComparer.Default).CopyToDataTable
  • Clone the DT3 data table
  • Apply the below exp to update the Result column
Variable of type Data Table FinalDT = (From d In DT3
Select FinalDT.Rows.Add(New Object(){d(0),d(1),d(2),"confirmed"})).copyToDataTable
  • Here I have taken four rows in input excel, so I have given in the exp as d(0),d(1),d(2),"confirmed", you can change this according to your rows. Let say you have five rows, in which last row is result column, then you can give as
d(0),d(1),d(2),d(3),"confirmed"

Output

1 Like

got this output bro
but I want row only if contains “Confirmed” in result column

@krishna_priya2

I guess you wrote the data back to same excel…and that is the reason as there are only two rows first two are updated…can you try writing to a new excel or sheet please

Cheers

No bro
last two row are unmated row so i don’t want those rows

@krishna_priya2

Are you using inner join?

I agree…but as the data is already present on excel and we have only two rows the remaining are not replaced…

Can you show your flow?

Basically you need to write to a new excel or clear the data on existing excel and write again or delete the exce and then write so that new excel with only new data is created

Cheers

THANKS for helping me bro error resolved

I use Filter Rows

1 Like

Thank you Sis for helping me

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