Hitachi Vantara Pentaho Community Forums
Results 1 to 6 of 6

Thread: Merging multiple column data to new column !!

  1. #1
    Join Date
    Mar 2013
    Posts
    66

    Default Merging multiple column data to new column !!

    Hi,

    Thanks in advance for your support.

    I have an input file as follows

    DA1 BAL1 DA2 BAL2 DA3 BAL3
    1 100 3 300 4 400
    2 200 1 400 6 600

    The output need to be as,

    DA BAL
    1 100
    2 200
    3 300
    1 400
    4 400
    6 600

    Can you please throw a light on this ? I am trying with row normalizer and d-normalizer but no results as of now.

  2. #2
    Join Date
    Nov 2008
    Posts
    777

    Default

    This one is a little tricky. I can get your desired result (except for the sort order) with a Row Normalizer step that creates a single new field followed by a Row Flattener step that flattens that new field to create the two output columns (DA and BAL).
    pdi-ce-4.4.0-stable
    Java 1.7 (64 bit)
    MySQL 5.6 (64 bit)
    Windows 7 (64 bit)

  3. #3
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    Quote Originally Posted by darrell.nelson View Post
    This one is a little tricky
    But only because it's such a lousy problem statement.
    Attached Files Attached Files
    So long, and thanks for all the fish.

  4. #4
    Join Date
    Nov 2008
    Posts
    777

    Default

    This is what I came up with. If the exact order of the desired result was needed, adding a sequence and then sorting would probably work.

    Name:  row_norm_flat.png
Views: 31
Size:  8.9 KB
    Attached Files Attached Files
    pdi-ce-4.4.0-stable
    Java 1.7 (64 bit)
    MySQL 5.6 (64 bit)
    Windows 7 (64 bit)

  5. #5
    Join Date
    Mar 2013
    Posts
    66

    Default

    Quote Originally Posted by marabu View Post
    But only because it's such a lousy problem statement.
    Marabu,

    Your logic is limited to level of BAL3, if there are more than 3, it would result lot of select steps and append streams.

    Anyways, thanks for your support.

  6. #6
    Join Date
    Mar 2013
    Posts
    66

    Default

    Quote Originally Posted by darrell.nelson View Post
    This is what I came up with. If the exact order of the desired result was needed, adding a sequence and then sorting would probably work.

    Name:  row_norm_flat.png
Views: 31
Size:  8.9 KB
    Sorry, forgot to specify this point !!. At present I dont need an order.

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.