Hitachi Vantara Pentaho Community Forums
Results 1 to 8 of 8

Thread: Column format

  1. #1

    Default Column format

    Hi All,

    Just i want to know how this logic works in kettle step.

    I have table data

    Input data:

    Entity_id | id | type | id | type
    123 | 245 | parent_id | 547 |ultimate_parent
    456 | 456 | parent_id | 784 |ultimate_parent
    789 | 741 | parent_id | 789 |ultimate_parent


    I need output below format :

    Entity_id | id | type
    123 | 245 | parent_id
    123 | 547 | ultimate_parent
    456 | 456 | parent_id
    456 | 784 | ultimate_parent

    Guide me which kettle step will do this logic.
    Last edited by mageshkumarm; 12-04-2013 at 08:23 AM.
    Thanks,
    Magesh

    pdi-ce-4.4.0-stable
    java 1.7.0_25 (OpenJDK
    )

  2. #2

    Default

    Quote Originally Posted by mageshkumarm View Post
    Hi All,

    Just i want to know how this logic works in kettle step.

    I have table data

    Input data:

    Entity_id | id | type | id | type
    123 | 245 | parent_id | 547 |ultimate_parent
    456 | 456 | parent_id | 784 |ultimate_parent
    789 | 741 | parent_id | 789 |ultimate_parent


    I need output below format :

    Entity_id | id | type
    123 | 245 | parent_id
    123 | 547 | ultimate_parent
    456 | 456 | parent_id
    456 | 784 | ultimate_parent

    Guide me which kettle step will do this logic.



    Hi,

    Hope attached will help you but I think this is not the optimal solution, though it might help you out.

    Thanks,
    Malay
    Attached Files Attached Files
    Last edited by mt25; 12-04-2013 at 12:21 PM. Reason: Grammer mistake

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

    Default

    Quote Originally Posted by mageshkumarm View Post
    Guide me which kettle step will do this logic.
    How would you do it without Kettle?
    So long, and thanks for all the fish.

  4. #4

    Default

    Quote Originally Posted by mt25 View Post
    Hi,

    Hope attached will help you but I think this is not the optimal solution, though it might help you out.

    Thanks,
    Malay
    Thanks & Great,

    I tried this logic, but I want it in one input step. Can we use row demoralizer step to get this format.
    Thanks,
    Magesh

    pdi-ce-4.4.0-stable
    java 1.7.0_25 (OpenJDK
    )

  5. #5
    Join Date
    Aug 2012
    Posts
    3

    Default

    Hi Magesh,


    your attachment containing ktr file is not opening .. can u please check on this and upload again


    Thanks,
    Abila

  6. #6

    Default

    Quote Originally Posted by Abila View Post
    Hi Magesh,


    your attachment containing ktr file is not opening .. can u please check on this and upload again


    Thanks,
    Abila
    Hi Abila,

    Just i want to know how this logic works in kettle step.

    I have table data

    Input data:

    Entity_id | id | type | id | type
    123 | 245 | parent_id | 547 |ultimate_parent
    456 | 456 | parent_id | 784 |ultimate_parent
    789 | 741 | parent_id | 789 |ultimate_parent


    I need output below format :

    Entity_id | id | type
    123 | 245 | parent_id
    123 | 547 | ultimate_parent
    456 | 456 | parent_id
    456 | 784 | ultimate_parent

    Give me some idea. how to do it in kettle step?
    Thanks,
    Magesh

    pdi-ce-4.4.0-stable
    java 1.7.0_25 (OpenJDK
    )

  7. #7
    Join Date
    Aug 2012
    Posts
    3

    Default

    Hi Magesh,

    Insert your input data into table and use this query to get the output in a file

    select
    a.entity_id, a.id, a.type from (
    select
    Entity_id, id as id, type as type from tablenameunionallselect Entity_id, id_1 as id, type_1 as type from tablename)a orderby entity_id,id;



    Thanks,
    Abila

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

    Default

    In PDI:

    Take your input, copy the row output to two select values steps.
    In the first, select Entity_id, id, type
    In the second, select (and rename!) Entity_id, id_1 (rename to id), type_1 (rename to type)

    Join these back together in your table output, or a dummy step, or sort rows, depending on what you need next.
    **THIS IS A SIGNATURE - IT GETS POSTED ON (ALMOST) EVERY POST**
    I'm no expert.
    Take my comments at your own risk.

    PDI user since PDI 3.1
    PDI on Windows 7 & Linux

    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.
    Signature Updated: 2014-06-30

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.