Has anyone ever had a data source that is two columns for the amount and they have to be added together in the file *-1?

OSAdmin
Valued Contributor
Originally posted by Andrea Tout

7/2/2019

Has anyone ever had a data source that is two columns for the amount and they have to be added together in the file *-1? 

3 REPLIES 3

OSAdmin
Valued Contributor
Originally posted by Andrea Tout

Dim currentCol As String = args.value
'Define secondary column
Dim Amount As Double = api.Parser.DelimitedParsedValues(2).XFConvertToDecimal
Dim Amount2 As Double = api.Parser.DelimitedParsedValues(3).XFConvertToDecimal
Return Amount + Amount2

coneill
New Contributor III

I had the same question! This is what I found worked:

1) In Data Sources, point the Amount to a row validator column*. This will NOT be the debit or credit amount column of data if that column might contain a zero for a valid row.

2) Update the 'Logical Operator for the Amount = Complex Expression, using the sample code shown below. NOTE: the first column of data is enumerated with a zero, not a one.

Dim DebitAmt as Double = api.Parser.DelimitedParsedValues(12).XFConverToDecimal

Dim CreditAmt as Double = api.Parser.DelimitedParsedValues(13).XFConverToDecimal

Dim NetAmt as Double = DebitAmt - CreditAmt

Return NetAmt

AK
New Contributor III

Hi,

Could you elaborate what does it mean by a row validator column?

Thanks