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.  Change an input type, then export in the same order without retyping all the fieldds

    Employee
    Posted 07-22-2014 22:19

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

    Originally posted by: dglavastorm

    Hi All, probably one of those very simple questions but I'm not sure how to ask it so can't find it in the forums

    I have a huge list of fields in my data, example as the below. The question is open to any data changes, but a current working example is I want to use a Filter to change "Due_Date" from Unicode to Date format, then emit all the data in the same order overriding Due_Date in the new format.

    Field List :
    Registration ID ; Date & Time ; Due_Date ; Status ; Date Downloaded ; Callback Ph ; Account FNN ; Employee_name ; Team_Name


    I use this formula to change Due_Date

    ACB_Due = 'ACB_Due_Date'.date("CCYY-MM-DD")
    emit 'Registration ID', 'Date & Time', ACB_Due as ACB_Due_Date, 'Status', 'Date Downloaded' etc.

    Is there any way to do the Emit function without having to type every field back out in the Emit statement keeping the ACB_Due_Date in the same header position . I tried override emit but it places the new column at the end.

    Hope that makes sense.

    Cheers,

    Dave


  • 2.  RE: Change an input type, then export in the same order without retyping all the fieldds

    Employee
    Posted 07-22-2014 22:38

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

    Originally posted by: Patman

    I was having the same..compulsion Then, I just try to arrange the fields at the end of the graph. There would be an extra filter node doing that and just ignore the field positions of the data from the prior nodes.


  • 3.  RE: Change an input type, then export in the same order without retyping all the fieldds

    Employee
    Posted 07-22-2014 23:06

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

    Originally posted by: dglavastorm

    Hi Patman, thanks for the reply :-)

    Unfortunately I need them in the same order as it concatenates with other data and then eventually exports to a template.

    Typing out the full list just because of a format change is painful.


  • 4.  RE: Change an input type, then export in the same order without retyping all the fieldds

    Employee
    Posted 07-23-2014 07:23

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

    Originally posted by: stonysmith

    Originally posted by: dglavastorm
    					

    Unfortunately I need them in the same order as it concatenates with other data and then eventually exports to a template.
    There are two answers here.
    1) At this time, LAE makes no warranty or (or attempt at) field order out of ANY node. It's a feature that has been requested, just hasn't been developed yet.
    2) But there is a "trick" that I have used:

    a) Add a Static Data node to your graph. In it, define all the columns you need, and in the order you desire to have them on the final output. Make sure you get the data types correct. In this node, you should not put any "data", just put the row defining the column headers.

    b) Add a CAT node, and connect the Static Data node to its first pin. Connect your main data stream to the 2nd pin. You can even set this CAT node to "INTERSECTION" type if there are some columns you would like to drop out.

    c) You should find that the CAT node will output the column(s) in the order from the static data node, and the order they are in from your main stream is ignored.

    3) If you prefer your current method, then in the LAL is a node that will "Get MetaData" - gives you a list of your field names and types. I have used that with a filter before to auto-generate some emits that I then paste back into a filter.


  • 5.  RE: Change an input type, then export in the same order without retyping all the fieldds

    Employee
    Posted 07-23-2014 17:11

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

    Originally posted by: dglavastorm

    Thanks for the reply Stony - the Cat node is an interesting thought as I've got a few wider applications I can apply this to (I'm still pretty new so my graphs are far from optimised ) .

    All up though, neither solution is really much quicker then just typing out the headings in a Filter - would be great to see this capability in a future update. I realise LS is designed more as an analysis tool than a reporting tool so column order isn't as critical, but I've been using it to slash hours of processing off my weekly reports.

    Thanks again for the replies :-)