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.  Scrutinize a data field to determine whether it contains alpha numeric data

    Employee
    Posted 12-01-2014 15:03

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

    Originally posted by: rbeliz000

    I have an output pin with 4 columns and about 1 million records.
    One of the columns (unit_address field) contains a data string with 8-16 characters. I would like to scrutinize that data field (unit_address) to determine whether it contains any letters. if it does contain at least one letter, i want to output it to a different output on a filter pin.

    Example:
    if unit_address field contains this data "000000194737AB36", I would like to have it output to pin 1 and taged as an alphanumeric data.
    if unit_address field contains this data "0001102639416036", I would like to have it output to pin 2 and taged as an numeric data.

    Looking for the simplest way to do this with consideration to the record count being over a million.

    Any suggestions/guidance would be greatly appreciated.

    thanks,
    Rich B


  • 2.  RE: Scrutinize a data field to determine whether it contains alpha numeric data

    Employee
    Posted 12-01-2014 15:10

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

    Originally posted by: stonysmith

    Add a Filter.
    Add a second output pin.
    Use this code:

    output 1 {
    emit *
    where not isDigit(unit_address)
    }
    output 2 {
    emit *
    where isDigit(unit_address)
    }


  • 3.  RE: Scrutinize a data field to determine whether it contains alpha numeric data

    Employee
    Posted 12-02-2014 02:06

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

    Originally posted by: andycooper

    In addition to Stony's excellent response, you could also use a Split Node and enter the following in the PredicateExpr field:-

    isDigit(unit_address)

    This option doesn't require the definition of a second output pin.


  • 4.  RE: Scrutinize a data field to determine whether it contains alpha numeric data

    Employee
    Posted 12-02-2014 02:47

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

    Originally posted by: andycooper

    Just to clarify further, isDigit requires the source field to be a string; you can also use the isNumber operator which evaluates any expression. There are also string operators for isAlpha and isAlphaNum which evaluate for alpha and alpha numeric strings accordingly.

    Ta


  • 5.  RE: Scrutinize a data field to determine whether it contains alpha numeric data

    Employee
    Posted 12-02-2014 07:35

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

    Originally posted by: rbeliz000

    The "isDigit" format worked out nicely. My exact syntax (inserted below) removed the preceding 0000 in the unit_address field for any record that qualified as a digit.

    output 1 {
    emit *
    where not isDigit(UNIT_ADDRESS)
    }
    output 2 {
    emit ACCOUNT_NUMBER, DIVISION, REGION, MARKET, SERIAL_NUMBER, DEVICE_MODEL, VIP, substr(UNIT_ADDRESS, 4,16) as UNIT_ADDRESS
    where isDigit(UNIT_ADDRESS)
    }


    thanks a bunch.
    Rich B