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

Thread: How to convert row to columns using denormalizer or any step

  1. #1

    Default transpose

    How to convert row to columns
    Last edited by rajeshbcrec; 06-23-2012 at 09:37 AM.

  2. #2
    Join Date
    Apr 2008
    Posts
    805

    Default

    Maybe using the Row De-normalizer step.
    http://wiki.pentaho.com/display/EAI/Row+De-normalizer

    Mick

  3. #3
    Join Date
    Nov 1999
    Posts
    9,535

    Default

    Here is an example from Super Slawo: http://type-exit.org/adventures-with...lds-in-kettle/
    Matt Casters, Chief Data Integration
    Pentaho, Open Source Business Intelligence
    http://www.pentaho.org -- mcasters@pentaho.org

    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 Freenode.net, channel ##pentaho

  4. #4
    Join Date
    Jun 2012
    Posts
    1,490

    Default

    One moment of hesitation might occur, when looking for an adequate input step.
    Attached Files Attached Files
    pdi-ce-4.3.0-stable
    OpenJDK IcedTea 2.3.7 (7u21)
    ubuntu 12.04 LTS (x86_64)

  5. #5
    Join Date
    Nov 1999
    Posts
    9,535

    Default

    Typically what you do is read the data line by line.
    Then you hook up a bit of JavaScript since you need to determine an ID for each line, I'm asuming Event=0, Event=1, and so on.
    You also split the data on the colon (:) and clean up the data a bit (description on the next line(s)).

    Then the denormaliser step is used.

    Happy hacking,
    Matt
    Last edited by MattCasters; 06-22-2012 at 10:57 AM.
    Matt Casters, Chief Data Integration
    Pentaho, Open Source Business Intelligence
    http://www.pentaho.org -- mcasters@pentaho.org

    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 Freenode.net, channel ##pentaho

  6. #6
    Join Date
    Jun 2012
    Posts
    1,490

    Default

    If you can't press the supplier of your data to conform to a more sane input specification, you will have to code a couple of lines.
    The "Property Input" step delivers the description torn apart like this:

    Code:
    key----------------------------------------------------------------- value------------
    description      
    The Software Protection service entered the stopped state.
    I suggest you throw in a User Defined Java Class to suppress the first row (key=description, value=none) and modify the following row by shifting the text to the value column and resetting the key to 'description'.
    pdi-ce-4.3.0-stable
    OpenJDK IcedTea 2.3.7 (7u21)
    ubuntu 12.04 LTS (x86_64)

  7. #7
    Join Date
    Jun 2012
    Posts
    1,490

    Default

    Why did you stop halfway?
    You were almost done...
    Attached Files Attached Files
    pdi-ce-4.3.0-stable
    OpenJDK IcedTea 2.3.7 (7u21)
    ubuntu 12.04 LTS (x86_64)

  8. #8
    Join Date
    Nov 1999
    Posts
    9,535

    Default

    It's not that hard to do and we already told you how to do it. So I don't think anyone is volunteering to write this for you.
    Matt Casters, Chief Data Integration
    Pentaho, Open Source Business Intelligence
    http://www.pentaho.org -- mcasters@pentaho.org

    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 Freenode.net, channel ##pentaho

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •