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.  Field Order after Look-up

    Employee
    Posted 10-06-2013 14:27

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

    Originally posted by: mwillett

    Hi,

    I am doing a simple lookup of transactional data against reference data.

    In this case, the transactional data is enriched with the "looked-up" value as an extra field at the end of each record (or null if no match found).

    Field order though is important in this example, so I would like to have this looked-up value update/overwrite the key field (so I end up with the same number of fields in each record). I know I can re-type the field order in that I want, in the look up or a later filter but wanted to know if there is a simpler way to achieve this task, as the record is fairly wide in terms of number of columns.

    Mike


  • 2.  RE: Field Order after Look-up

    Employee
    Posted 10-06-2013 18:05

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

    Originally posted by: stonysmith

    What you are asking for is tricky at best.
    LAE specifically "doesn't care" about column order, so it makes it difficult if you need to output fields in a specific order.

    I have a suggestion, but it will require a bit more explanation than this forum thread may allow..

    Step 1:
    In the LOOKUP:

    emit *
    override emit 2:desiredColumn as desiredColumn

    (unfortunately, this moves the desired column to the far right)

    Step 2:
    add a FILTER node
    define a new parameter on the node as a FIELDHELPER type

    Then, using the FieldHelper tools, you can sync the field helper to the input and then simply use the up/down arrow to specify move the column back into the correct position.

    You'll have to read up on FieldHelper - it can be a bit obtuse.


  • 3.  RE: Field Order after Look-up

    Employee
    Posted 10-06-2013 21:17

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

    Originally posted by: mwillett

    Thanks, perhaps the easiest way is tohard code in the column order wanted in the X-Ref


  • 4.  RE: Field Order after Look-up

    Employee
    Posted 10-07-2013 07:59

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

    Originally posted by: mmarinelli

    One way to alter the order of fields is to use the Change Metadata node from LAL. It can be a better approach than coding in BRAINscript, as it externalizes the ordering logic. I've attached an example graph which implements column resorting using this node. This doesn't directly address your Lookup issue, but I thought it would be useful information in general.
    Attachments:
    reorder_columns_example.brg