
I want first check the if there is any row having same value for the column “ORIGINAL POLICY NUMBER”
If yes - i want to add the first row value ie 198.17-0 = 198.17
Then want to add the 2nd row value ie 0 -198.17 = -198.17
So the sum of total value is zero then i want to remove from the data table
Hi @Gokul_Murali
Try this linq
dt_result = dt_input.Clone()
dt_result = (From row In dt_input.AsEnumerable()
Group row By key = row("ORIGINAL POLICY NUMBER").ToString() Into grp = Group
Let sumValue = grp.Sum(Function(r) CDbl(r("GROSS PREMIUM")) - CDbl(r("RETURN PREMIUM")))
From r In grp
Where sumValue <> 0
Select dt_result.LoadDataRow(r.ItemArray, False)).CopyToDataTable()
Hope this helps!