I want to filter records dynamically on user choice. The user may choose to show the debit amount greater than credit or credit amount greater than debit. Accordingly I want to put a condition similar to either totDebit>totCredit or
TotCredit>totDebit`
Dim query = _
From product In Bills.AsEnumerable() _
Group product By accode = product.Field(Of String)("ACCODE"), _
BILLNO = product.Field(Of String)("BILLNO") Into g = Group _
Let totDebit = g.Sum(Function(proudct) proudct.Field(Of Decimal)("DEBIT")) _
Let totCredit = g.Sum(Function(proudct) proudct.Field(Of Decimal)("CREDIT")) _
Select New With _
{ _
.ACCODE = accode, _
.billno = BILLNO, _
.TOTALDEBIT = totDebit, _
.TOTALCREDIT = totCredit, _
.BALNACE = totDebit - totCredit _
}
How can this be done?