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.
Hi @Brian_Henokh1 - From where you will get the difference Price value?
Price value in each data table is manual input. That value as in the Pict 1 and Pict 2
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)
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
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.