Compare Data Table

Hello,

Please help me to compare this two Data Table (DT1 : DT2). Each data table have a column name is Currency and Price. My job is comparing that data tables to check the Price value is same one to another. If the Price in DT1 and DT2 isn’t same (as in the picture), i will displaying that different Price.

Pict 1:

Pict 2:

Regards,
Brian

Hi @Brian_Henokh1 - From where you will get the difference Price value?

Regards,
AK

1 Like

Price value in each data table is manual input. That value as in the Pict 1 and Pict 2

Hello @Brian_Henokh1
you can use linq here and using linq you will get list of all not equal price and thn using String.join method you can display that price in a message box or writeline this is the code used in workflow

String.Join(",",(DT2.AsEnumerable().where(function(d1) not(DT1.AsEnumerable().Any(Function(d2) d1(1).ToString=d2(1).ToString )) )).Select(Function(r) CStr(r(1)).ToString).tolist)

Check the workflow for better understanding
Comparingtwodt.xaml (9.8 KB)

1 Like

Hi @Brian_Henokh1, Try the below query

Assign CurrencyDT3 = (From sheet2 in CurrencyDT2.Select Where (From sheet1 In CurrencyDT1.Select Where sheet2(“Price”).ToString.Equals(sheet1(“Price”).ToString) Select sheet1).Count <> 1 Select sheet2 ).CopyToDatatable()

Create CurrencyDT1 and CurrencyDT2 as shown in the image below

CurrencyMatchDT

CurrencyMatchDT1

Thanks,
AK

1 Like

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