US and Worldwide: +1 (866) 660-7555
Results 1 to 6 of 6

Thread: Transpose multiple column row values to one (using Javascript?)

  1. #1

    Thumbs up Transpose multiple column row values to one (using Javascript?)


    I would like to transpose a list of around 200 subsequent row values in one column into 1 row/field value. I am generating a dynamic SGL statement.

    As far as I know there is no standard step that could do this, right?


    row1 | A
    row2 | B
    row3 | C
    row200 | X

    Should become:

    row1 | ABC..X

    Could this be done using Javascript? or is JS only capable of doing single row oriented transformations?


  2. #2
    Join Date
    Nov 2008


    I would think you could make the Row Flattener step perform this operation.
    Java 1.7 (64 bit)
    MySQL 5.6 (64 bit)
    Windows 7 (64 bit)

  3. #3


    Hi Darrell,

    I looked into that but the Row Flattener divides multiple row belonging to a certain group into multiple columns. Moreover you have to know the number of result columns upfront, so it is not dynamic.

    Funny is that I found an example of exactly the opposite of what I want to achieve in the kettle samples (using javascript);
    (see "Javascript create new rows" sample)
    Last edited by Jasper; 04-13-2011 at 10:40 AM.

  4. #4
    Join Date
    Apr 2008


    Group By?
    Concatenate values option?
    Please keep in mind (and this may not apply to this thread):
    No forum member is going to do your work for you. We will help you sort out how to do a specific part of the work, as best we can, in the timelines that our work will allow us.
    I'm no expert.
    Take my comments at your own risk.

    PDI user since PDI 3.1
    PDI on Windows 7 & Linux
    Signature Updated: 2014-04-02

  5. #5
    Join Date
    Nov 1999


    I'm so proud of you gutlez. Finally someone to help me in my quest to eradicate JavaScript in ETL!
    Matt Casters, Chief Data Integration
    Pentaho, Open Source Business Intelligence --

    Author of the book Pentaho Kettle Solutions by Wiley. Also available as e-Book and on the Kindle reading applications (iPhone, iPad, Android, Kindle devices, ...)

    Join us on IRC server, channel ##pentaho

  6. #6


    Thank you Gutlez!

    That will do just fine.

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