Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: Group By - how can I aggregate a stream field (concatenate str) to only pass n vals?

  1. #1

    Question Group By - how can I aggregate a stream field (concatenate str) to only pass n vals?

    All -

    I have many rows of data that have a one to many relationships that I am using Group By step. I then choose some stream fields to agrregrate Type = Concatenate strings separated by,

    The issue is that there are too many and I just want the first n values only to be included in the concatenate.

    Here is an example of rows:

    Hostname,Application,SupportGroup
    host1,app1,supporta
    host1,app2,supportb
    host1,app3,supportb
    host1,app4,supportc
    host1,app5,supportd
    ....

    What I get today is (after using Group By) is:

    host1,"app1, app2, app3, app4, app5, ...","supporta, supportb, supportb, supportc, supportd, ..."

    What I want is to limit to only 4 values max! So the end result I want is:

    host1,"app1, app2, app3, app4","supporta, supportb, supportb, supportc"

    Please advise! Thank you in advance Gurus!!

    KP

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

    Default

    Not that it's a good way, but you could run it through a "Add value fields changing sequence" and then filter for counter < 5 before running it through the Group By step.

  3. #3

    Default

    Brilliant and simple idea!!!

    Thanks for the quick response.

    KP

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.