Forum Discussion

OSAdmin's avatar
OSAdmin
Valued Contributor
5 years ago

How can I combine two source fields to generate one destination, such as UD2?

Originally posted by Patrick Kiernan

4/22/2019

How can I combine two source fields to generate one destination, such as UD2? I have a source number field, and where that doesn't exist the source description is to be used. For instance I have Supplier Number and that is what I am using as my UD2 Filed and then the description as an Attribute, but how can I use that Attribute to map if there is no supplier number? Example of data

  • OSAdmin's avatar
    OSAdmin
    Valued Contributor
    Originally posted by Nick Kroppe

    this should look much like the golfstream debits and credits parser rule. Essentially, you'll want to test if the supplier number field is empty, if it is, use the supplier name. I am attaching code below that is untested but should hopefully point you in the right direction. This logic would be called on the Ud2 data source dimension in either a complex expression or parser business rule
    'if the supplier number is empty, return the supplier name
    If String.IsNullOrEmpty(args.Value) Then
    'zero based index - get the supplier name column and column value
    Dim supplierNameColPosition As Integer = 3
    Dim supplierName as string = api.Parser.DelimitedParsedValues(supplierNameColPosition)
    Return supplierName
    Else
    Return args.Value
    End If