Compare 2 columns from 2 datatables and get mismatch value of one column

Hi,

I need to compare 2 columns named “ID” and "Sum " from 2 data tables like ID from table 1 equals id from table2 and sum from table 1 equals sum from table 2 and get mismatch value of sum from table 1 if the id and sum are not equal

please find the attached excel with data Sample.xlsx (14.8 KB)

@sravyarao20

Check below post for your reference
Tutorial : How to check a string is present in Excel Sheet || Part - 1
Tutorial : Check value exists in Excel Sheet using UiPath (Part-3) | Without using ForEach Loop/FilterDatatable

Hope this helps you

Thanks

@sravyarao20
Find starter help here:
sravyarao20.xaml (9.9 KB)

with the join data table (Left join from dt1 to dt1) the sceanrio is solveable
Kindly note: some column name values do have blanks on the end. So the same in column name references is to use

while casting to decimal if the column contains blank values invalid casting exception for object for dbnull is coming how that can be solved?

you can extend the check within the if activity
mybe it can be tricked as following:
Convert.ToDecimal(“0” & row(“Sum”)) = Convert.toDecimal(“0” & row(“Sum_1”))

I will have a look on it later and will come back to you

okay, tried this Convert.ToDecimal(“0” & row(“Sum”)) = Convert.toDecimal(“0” & row(“Sum_1”)) but there is error to not use & operand

sorry was a too fast shot, find updated here:
Convert.ToDecimal(“0”& row(“Sum”).toString) = Convert.toDecimal(“0” & row(“Sum_1”).toString)
grafik

1 Like

Thank you its working

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