Hello all,
I use filter to comparison but I want relative comparison ± 0.05. Thank all
Amount column: 10602.38
Tong Tien column: 10602.39
Hello all,
I use filter to comparison but I want relative comparison ± 0.05. Thank all
Amount column: 10602.38
Tong Tien column: 10602.39
"[Amount] >= " + (10602.38 - 0.05).ToString + " And [Amount] <= " + (10602.39 + 0.05).ToString
Hope this works
Hi,
Unfortunately, FilterDataTable activity doesn’t support such calculation.
Can you try as the following?
arrDr = dt.AsEnumerable.Where(Function(r) Math.Abs(CDbl(r("Amount"))-CDbl(r("Tong Tien")))<=0.05).ToArray()
Note: arrDr is DataRow array type.
Regards,
Hi @Yoichi
Because i need to compare 2sheet. How can I use your code ?
Assign: Column ‘Tổng Tiền’ does not belong to table DataTable.
“Tổng Tiền” column in dt2
“AMOUNT” column in DTfilter
Hi,
Do you want to compare same row index data in both datatable?
If so,can you try the following expression. it’s unnecesary to use ForEachRow activity.
dtFilter = dt.AsEnumerable.Where(Function(r,i) Math.Abs(CDbl(r("Amount"))-CDbl(dt2.Rows(i)("Tong Tien")))<=0.05).ToArray()
Regards,