How to compare 2 sheet and check status

Hello,

I have 2 sheets that need compare and return status OK or NO,
Compare A column sheet Result with B column sheet DLV030. If matching check OK do action1, else NO do action2. Thank you
image

DLV030 - Copy.xls (42 KB)

@anh.nguyen

Read dlc sheet into a datatable dt

Then loop through the result sheet using for each row in excel

Then use filter datatable activity inside loop and filter column B with currentRow.Field("Number Container")

And then use if condition with filtereddt.RowCount > 0

On the then side use assignn and assign ok to the required field and on else side assign No

Hope this helps

Cheers

1 Like

Can you explain more for me in workflow? Thank you

DLV030.xaml (58.4 KB)

Hi @anh.nguyen

Please try again with this
DLV030.xaml (59.1 KB)

Regards

Hi @fernando_zuluaga

Open file error

Well, please do this small change in your workflow

Regards!

1 Like

@anh.nguyen

If you are reading both tables into datatable then use Currentorw(“Number Contoner”).ToString

I asked you to use for each row in excel which is a different activity and the syntax would be as provided previously…

Please change to this syntax as you are using for each row in datatable

cheers

1 Like

Oh thank you, run check oki but now how I can write at B column OK or NO
image

@anh.nguyen

Use assign currentrow("Final Check") = "Ok" and currentrow("Final Check") = "No"

cheers

1 Like

It not write into B column

Hi @anh.nguyen

  • You can convert the Excel sheets into DataTables and then use a nested For Each loop to make the comparison.

  • You can use Read Range activity to read data from an Excel sheet and store it in a DataTable.

  • Then you can use For Each Row activity to loop through each row of the DataTable

  • You can use If activity to compare two rows of data

Check out this Video link

Regards
Gokul

1 Like

Thank all. It’s work :slight_smile:

1 Like

@anh.nguyen

Did you write into excel as well using write range after this?

Cheers

Yes, add more write range :slight_smile:

1 Like

@anh.nguyen

Hope this clears your issue as well

Happy Automation

cheers

1 Like