LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  Replace "Null" or "?" values

    Employee
    Posted 03-19-2014 12:34

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: mw9286

    I have two tables I am trying to match but the offer field in one table is populated will "NULL" and the other table is populated with a "?". How do I replace the value of null and question mark with "999999"


    Table 1:

    CUSTOMER OFFER EFFECTIVE_DATE AMOUNT
    123 NULL 2014-01-03 99

    Table 2:

    RECEIVER_CUSTOMER EFFECTIVE_DATE OFFER AMOUNT
    123 1/3/2014 ? 99

    Thank you,

    Mike


  • 2.  RE: Replace "Null" or "?" values

    Employee
    Posted 03-19-2014 13:09

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: Tim Meagher

    I assume the data in these fields are of a string type and you want to leave them as string, but have the field value as "999999"

    If so, you can just use a Filter node.
    For the filter for table 1, you should just need:

    newVal = 'OFFER'
    if (newVal.isNull()) then
    newVal = "
    999999"

    emit *
    overwrite emit newVal as "OFFER"


    For the second filter, you can use:

    newVal = 'OFFER'
    if (newVal == "?") then
    newVal ="999999"

    emit *
    overwrite emit newVal as "OFFER"


    Hope this helps,
    Tim.