Hitachi Vantara Pentaho Community Forums
Results 1 to 7 of 7

Thread: File record 1 to many

  1. #1
    Join Date
    Jan 2009
    Posts
    11

    Default File record 1 to many

    Hi all,

    I have an input file like this :
    head1 data1-1 data1-2
    head1 data2-1 data2-2
    head1 data3-1 data3-2
    head2 data4-1 data4-2
    head3 data5-1 data5-2

    In file output i want
    head1
    data1-1
    data1-2
    data2-1
    data2-2
    data3-1
    data3-2
    head2
    data4-1
    data4-2
    head3
    data5-1
    data5-2

    What is the mean to do this with kettle ?
    Should you help me ?

    Joel

  2. #2
    Join Date
    Apr 2008
    Posts
    4,696

    Default

    If it's ALWAYS 3 columns, and DataN-1 and DataN-2 are ALWAYS the same type...

    you could use a row normalizer step.

  3. #3
    Join Date
    Feb 2009
    Posts
    321

    Default

    another option is using a combination of steps. you must works in differents flows. for join this flows use the step "append stream" (don`t forget sort the fields) and later use a "row normalizer " step.

  4. #4
    Join Date
    Jan 2009
    Posts
    11

    Default

    I think that i can't use normalizer step because my data are not realt coarse.

    In fact, when I say head1, I think invoice 's header information (number, addresses, sum...) and for 1 detail, I think about 1 article, quantity, price ...)
    For each I have some treatment and output line.

    I think it's a classicle problem, but I don't know how to do it with pentaho.
    Because in transformation there is no sequential order

  5. #5
    Join Date
    Jan 2009
    Posts
    11

    Default

    Quote Originally Posted by hernanthiebaut View Post
    another option is using a combination of steps. you must works in differents flows. for join this flows use the step "append stream" (don`t forget sort the fields) and later use a "row normalizer " step.
    Thank for your response but :
    When you says "differents flows" you think "transformations" ?
    what is "append stream" ?

    have a nice day
    Joel

  6. #6
    Join Date
    Sep 2007
    Posts
    834

    Default without Normalizer

    Suppose the fields are named head, data1, data2
    1) Create a new string field as:
    aux_field = data1 + ',' + data2
    2) Use Group by to create a field named aux_field_2:
    Group by: head
    Aggregation: aux_field separated by ','
    3) Create a last string field as:
    aux_field_3 = head + ',' + aux_field_2
    4) Use 'Split field to row' to split aux_field_3.

    Many steps, but easy to do.
    mc

    Quote Originally Posted by jma01 View Post
    Hi all,

    I have an input file like this :
    head1 data1-1 data1-2
    head1 data2-1 data2-2
    head1 data3-1 data3-2
    head2 data4-1 data4-2
    head3 data5-1 data5-2

    In file output i want
    head1
    data1-1
    data1-2
    data2-1
    data2-2
    data3-1
    data3-2
    head2
    data4-1
    data4-2
    head3
    data5-1
    data5-2

    What is the mean to do this with kettle ?
    Should you help me ?

    Joel

  7. #7
    Join Date
    Jan 2009
    Posts
    11

    Default

    I think that the idea is good ...

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.