Hitachi Vantara Pentaho Community Forums
Results 1 to 6 of 6

Thread: row into column group

  1. #1
    Join Date
    Mar 2016
    Posts
    3

    Question row into column group

    I have one step that I need to concat x rows into one separated by coma or similar. I have this data on my final step:
    Name:  Captura.jpg
Views: 53
Size:  23.3 KB


    I need to have the "tarifas" row in the same column with the 5 diferent "tarifas" for the same "REFERENCIA" : example:


    tarifas:


    T00:6.9000,T01:7.9000,T02:8.9000,T03:9.9000,T04:10.9000,T05:11.9000


    I saw denormalizer step but can't get a good result.

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

    Default

    You want to have a single row for each reference with all tariffs in a single column?

    The Group-By step has a "concatenate" function for this.
    Attached Files Attached Files
    So long, and thanks for all the fish.

  3. #3
    Join Date
    Mar 2016
    Posts
    3

    Default

    Quote Originally Posted by marabu View Post
    You want to have a single row for each reference with all tariffs in a single column?

    The Group-By step has a "concatenate" function for this.
    That worked but for some reason I am getting dupplicates on the new row "tarifas" separated by comma, any idea to prevent or fix this?

    Name:  Captura.jpg
Views: 50
Size:  41.7 KBName:  Captura2.jpg
Views: 47
Size:  23.8 KB

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

    Default

    If my eyes were better, my nickname probably would be hawk or eagle.
    Can't you attach sample data as CSV or in a Data-Grid?
    So long, and thanks for all the fish.

  5. #5
    Join Date
    May 2016
    Posts
    282

    Default

    Hi Gerardlc, probably you're getting dupplicates because you have dupplicates in your source data, you can perform a SORT step with only the columns you are interested in, and check the Only pass unique rows? (verifies keys only) before de GROUP BY step.
    Regards

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

    Default

    Duplicates occur when the Sort step isn't configured properly.
    In this case if the second field (b2btad_referencia) isn't the primary sort field.


    Also, if you decide to post a question to multiple forums that's the first thing I want to read in a post.

    It's a matter of respect.

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.