Data360 Analyze

Welcome to the Data360 Analyze community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Here are some useful links where you can find more information:

Product Announcements  Product Documentation  Ideas Portal

Discussions

Members

Resources

Events

 View Only
  • 1.  Generating multiple rows

    Employee
    Posted 03-16-2017 05:27

    can someone share an example on how to create multiple rows base on one row of source information, and to write the generated rows to the same output, say delimited file?

    The number of rows to be generated depends on a logic with reference to the source field(s).



  • 2.  RE: Generating multiple rows

    Employee
    Posted 03-16-2017 06:07

    Since the forum does not permit LNA files to be posted here, I have written up a Help Center post where you can find the code.  Even so, here are the details of that example.

    The example uses the Transform node to output multiple records for a single input record. The records could be published to a file using the Output Delimited node, as usual.

    The data flow is as follows:

    The data in the Static Data node is:

    account:int,state list:string
    11111111,"FL, MA, NE"
    22222222,"CA, AZ, NV, NM"

    In this case the Transform node has been configured with some custom properties (defined in the 'Define' tab of the node's configuration panel) :



  • 3.  RE: Generating multiple rows

    Employee
    Posted 03-16-2017 07:20

    Thank you!

    How is this compares to having one source node sending outputs to multiple transform nodes (in terms of performance and other considerations)?

    Also, if I use multiple transform nodes, is there a way to merge the output back to a single file?



  • 4.  RE: Generating multiple rows

    Posted 03-16-2017 15:35

    Dear Shu,

    For your first question, I presume you are talking about a situation similar to the one described here.  In that case, I would say the following:

    • The first approach--the one with the three nodes--is easier to understand, but the code will mostly likely run more slowly as the input data has to be read in three times.
    • The second approach is a bit more complicated but will most probably run faster since the node only has to run over the input data once.

    Other than that, there are very few considerations.

    I will provide an answer to your second question tomorrow.

    Hope that helps,

    Rocco



  • 5.  RE: Generating multiple rows

    Employee
    Posted 03-16-2017 21:51

    It is helpful. Thank you.

    Look forward to your insights on the second question. Cheers.



  • 6.  RE: Generating multiple rows

    Posted 04-07-2017 14:37

    Hi Shu,

    I just realized that we did not answer your second question.  If you have multiple data sets that you want to add together into a single data set you would use the Cat node.  This node will concatenate the data from each input into a single output.  If the fields are the same for all inputs then no configuration is needed.  If the fields from the inputs are different then you will need to set the ConcatenationMode parameter on the Cat node to either Union or Intersection.

    Regards,

    Larry