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.  Matching Fields Accross a Record

    Employee
    Posted 01-21-2010 10:03

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

    Originally posted by: mblake

    I am trying to match two data elements accross one record of a table. For example:

    Example Table

    Field Name Field_NM1 Field_NM2 Field_NM3 Field_NM4
    Row 1 cat boat dog car
    Row 2 buffallo train buffallo plane
    . . . . .
    . . . . .
    Row 1000 emu zepplin emu ship

    In this case I want to find all the rows that where Field_NM1 and Field_NM3, so the output in this case would be:

    Field Name Field_NM1 Field_NM2 Field_NM3 Field_NM4
    Row 1 cat boat dog car
    . . . . .
    . . . . .
    Row X emu zepplin emu ship

    Is their and easy way to do this or do I have to split the table into two and create a key for each table then match it that way?

    Thanks for your help!


  • 2.  RE: Matching Fields Accross a Record

    Employee
    Posted 01-21-2010 10:12

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

    Originally posted by: rboccuzzi

    I think you meant that you wanted to output the second row (buffallo == buffallo, not cat == dog).

    If that is what you meant, you can do this with a simple filter or split node. For a filter node, you would just say

    emit *
    where 'Field_NM1' == 'Field_NM3'

    the where statement will restrict the output to only those records where your expression is true.

    If you would like to use a split node so you can see all the records that passed and those that failed, you would just put:

    'Field_NM1' == 'Field_NM3'

    Inside the condition parameter, and all those on output 1 would have the same value in the two fields, and those on output 2 would have different ones.

    Cheers
    Rich


  • 3.  RE: Matching Fields Accross a Record

    Employee
    Posted 01-21-2010 10:16

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

    Originally posted by: mblake

    Yes you are correct about the second row.
    That seems very easy to do. I'll try that out. Thank you for the quick reply.


    Originally posted by: rboccuzzi
    					

    I think you meant that you wanted to output the second row (buffallo == buffallo, not cat == dog).

    If that is what you meant, you can do this with a simple filter or split node. For a filter node, you would just say

    emit *
    where 'Field_NM1' == 'Field_NM3'

    the where statement will restrict the output to only those records where your expression is true.

    If you would like to use a split node so you can see all the records that passed and those that failed, you would just put:

    'Field_NM1' == 'Field_NM3'

    Inside the condition parameter, and all those on output 1 would have the same value in the two fields, and those on output 2 would have different ones.

    Cheers
    Rich