Compare 2 data table

Hello all,

I read dt1 & dt2. Now I need to compare dt1Total - dt2Total = ? (same INV) and write into dt1Compare. Thank all
dt1
INV,Total,Compare
00000210,9348000
00000211,16195410

dt2
STT,INV,Số seri,Ngày hóa đơn,Mã phiếu,Tiền tệ,Thành tiền
trước thuế,Thuế,Thành tiền thuế,Thành tiền
sau thuế,Total
1,00000210,1C23TLS,VND,9347999,0,9347999
2,00000211,1C23TLS,VND,14723099,1472310,16195411

Hi @anh.nguyen
I have attached zip file your reference.
BlankProcess3.zip (189.5 KB)

I hope it helps!!

1 Like

Hi,
I check some wrong ?
INV: 00000210 only in dt1 so why compare : - 6847410

image

@anh.nguyen

Follow the steps

  1. For each row in datatable dt1
  2. Inside the loop use filter datatable activity on dt2 with filter on rows and with kewp and filter as "INV" equals currentRow("INV").ToString
  3. Now use assign activity with currentRow("Comparer") = (CdBL(currentRow("Total").ToString) - CDBL(dt2.Rows(0)("Total").ToString)).ToString

Hope this helps

Cheers

1 Like

@anh.nguyen

On the above is to be given on right side of assign

CurrentRow("Comparer") is to be provided on the left side

Cheers

1 Like

@anh.nguyen

Please find the detailed xaml for the same

https://forum.uipath.com/uploads/short-url/kMtbonDaEM1JDhr7Lh594Q8SC36.zip

Cheers

1 Like

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