Private Sub NCIElim(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As FinanceRulesApi, ByVal args As FinanceRulesArgs,ByVal pmin As Decimal)
Dim ResulDataBuf As DataBuffer = New DataBuffer()
Dim DestinationInfo As ExpressionDestinationInfo = api.Data.GetExpressionDestinationInfo("C#Elimination:O#Elimination:A#ShareCapital")
Dim SourceBufferFilter As DataBuffer = Api.Data.GetDataBufferUsingFormula("FilterMembers(C#Share:O#Top:A#ShareCapital)")
SourceBufferFilter.LogDataBuffer(api,"records",100)
For Each sourceCell As DataBuffercell In SourceBufferFilter.DataBufferCells.Values
Dim ResultElse As New DataBuffercell(sourceCell) 'Copying the modified buffer cell to new result cell
ResultElse.CellAmount = ResultElse.CellAmount * - 1
If (Not sourceCell.CellStatus.IsNoData) Then
ResulDataBuf.setcell(si,ResultElse,True) ' Set result cell result buffer to save this later to destination
End If
Next
api.Data.setdatabuffer(ResulDataBuf,DestinationInfo)'Save the data into destination.
End Sub