Hi Team,
How to compare Current Row with Previous row Value from Datatable using asp.net C#
I have table like below.
Table Name: Chk_Current_Data
Suply_Qty |
Prcnt_Claim |
4 |
70 |
2 |
30 |
6 |
35 |
4 |
70 |
4 |
30 |
2 |
70 |
By using above table i want to filter the data comparing values with current and previous values using below condition
In my conditions, Our Total percentage of Claim for suply_Qty is 100 (not all columns sum of percentage of claim)
we have to take suply_Qty and Prcnt_Claim.
Suply_Qty=4
Prcnt_Claim=70
Remain_Prcnt_Claim=100-70=30% for suply_Qty=4
Here we have to check and compare with suply_Qty=4 and Prcnt_Claim=30%
if we found suply_Qty=4 and Prcnt_Claim=30% in the remaining rows then we have to remove both the rows from Chk_Current_Data Table.
if not found then add this row into another Table: Filter_Data;
after completing of 1st-row condition we have to check another under Chk_Current_Data table(Now this table is updated because we have removed two rows if the condition pass).
we have to repeat the same condition for updated rows under Chk_Current_Data.
By using the above conditions I want to get the below data table(Filter_Data) data
Qty |
Pndng_Claim |
6 |
65 |
4 |
70 |
How to solve the above condition
Thanks in Advance