Excel file comparison - Pass / Fail problems (File provided)

Hello,

I have been working to compare two workbooks inside of the same excel file. I have been stuck and cannot seem to fix my problem. My application is enclosed in this ticket, if someone could help with a correction I would greatly appreciate it.

I am looking to confirm that 5 values match in both workbooks, if so I would like “Pass” to be written at the end of the row in excel (Column S). If the records do not match I would like “Fail” to be written at the end of the row.

Problems
The system will only write the first row and is writing fail although it should be pass

I can get the application to run when searching for just one value but when I add the other 4 I receive an error “The source contains no data” I assume this means that there is blank data in one of the cells?

If someone could help me with this I would greatly appreciate

Validation.xaml (10.5 KB) it.

Hi,

Can you share your input files and output which you expect?
It’s no problem if dummy data.

Regards,

Dummy data.xlsx (11.0 KB)

Here is a dummy file. Thank you for the help! I am really struggling with this and the project is overdue…

Hi,

Thank you for sharing your data.
However, it fails in your workflow because of mismatch number of columns. Can you show us which column should be compared in dummy data?

Regards,

Here is an example of 4 of the items

(From d1 In dt1.AsEnumerable

From d2 In dt2.AsEnumerable

d1(“C”).ToString.Trim.Equals(d2(“Nm”).ToString.Trim) And d1(“VC”).ToString.Trim.Equals(d2(“SC”).ToString.Trim) And d1(“UP”).ToString.Trim.Equals(d2(“a21”).ToString.Trim) And d1(“TP”).ToString.Trim.Equals(d2(“aa”).ToString.Trim)

Select d2).CopyToDataTable

1 Like

Hi,

How about the following sample? Is this same as what you expect?

Sample20210108-2.zip (22.1 KB)

Regards,

1 Like

Yoicih,

I ran the application and after deleting the data in column S I see that Pass and Fail are written. I thought they were missing but I see the values overwrite my Results file. I will have to see about implementing your fix into my production application.

thank you for your help!!!

1 Like

Hi Yoichi,

I accidentally overwrote my only results file with Dummy data. I am now getting an error that “c” on d1 does not exist in my data table although it is on the spreadsheet. Do you know why this might be occurring? I am probably overlooking something very minor here…

Hi,

For now, can you check content of dt1?
We can see it at local panel, if run debug mode and exception occurs.

Regards,

Hi,

It was a typo on my side, I think I spent too much time at the keyboard yesterday. Thank you for your help! I think this solution will help many others!

1 Like

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