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.  Generate field names from field contents?

    Employee
    Posted 04-07-2016 09:29

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

    Originally posted by: djnrempel

    I have two fields, each of which contains a comma separated list. I want the values in the first list to become the field names that the second set of values are mapped to. Any ideas how to do that?


  • 2.  RE: Generate field names from field contents?

    Employee
    Posted 04-07-2016 09:41

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

    Originally posted by: stonysmith

    Is it possible for you to share a couple of rows from each list?

    I'm pretty sure this is possible by using the Change Metadata node, but I need to see the data.


  • 3.  RE: Generate field names from field contents?

    Employee
    Posted 04-07-2016 10:05

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

    Originally posted by: ryeh

    Hi, Daniel. It's been a while!

    I just did this with another customer two days ago. Not sure if it's the same thing you're after. See if it works. There are ways to consolidate the nodes (and improve performance), but I've broken it out into steps so it's easier to follow.

    But definitely post your data if you can. Stony can provide a more scalable example.
    Attachments:
    Fieldnames_Values.brg


  • 4.  RE: Generate field names from field contents?

    Employee
    Posted 04-07-2016 14:23

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

    Originally posted by: djnrempel

    Hey guys, thanks!

    Ryan, your example helped. No point posting a sample because my data was basically exactly like what your graph has after the "Join Inner" node.

    I tried hooking that right up to the Pivot - Data to Names node but that didn't work, I didn't understand how that node worked by grouping. Having seen your example I now know how to prep data for that node. Thanks!


  • 5.  RE: Generate field names from field contents?

    Employee
    Posted 04-07-2016 14:27

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

    Originally posted by: djnrempel

    If this can be done better by the Change Metadata node, I'd be interested in that!


  • 6.  RE: Generate field names from field contents?

    Employee
    Posted 04-13-2016 08:52

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

    Originally posted by: ltolleson

    Hi Daniel,

    I like what Roger has done and I believe it is a scalable option. I use his method often. But in the spirit of being different I can show you another way this can be done.

    See the attached example I added to Roger's graph.

    Ok, let me explain what is happening in this graph.
    • First, the two datasets are concatenated together into a single field. Make sure the field name is the same for both datasets. I called the field "data".
    • Since the data already has a delimiter (commas) we can output this single field using the "Output Delimited" node. This node is doing a few tricky things, so let me explain.
      • First it is saving the file to the users temp directory. This is done by simply adding a filename without a path. I use this method when a file is only being used as temporary storage in a process.
      • This node is outputting just the data, which is the comma separated header and field values, and not the header you see in BRE. This is done by setting the "Field Names" parameter to "None".
      • Set the record and field delimiters both to "\n" which will write the entire record as you see it in BRE to the file. Since the data already have commas there is no need to add them on this output node.
    • Use the "Delimited File" node to read the data written by the previous step as a comma delimited file. This node must be clocked to the previous "Output Delimited" node so it will run only after the output node has completed.
      • Set the "File" parameter to the name used in the "Output Delimited" node.
      • Set the "Field Delimiter" parameter to a comma ",".
      • Set the "Record Delimiter" parameter to a new line "\n".
    Whether or not you use this technique for this application, you will have it in your back pocket for future uses.

    Thanks,
    Larry
    Attachments:
    Fieldnames_Values.brg