Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: Group By Step

  1. #1

    Default Group By Step

    Hi, I am trying to extract records from an input stream that have the maximum value for a given field for a group. The output of the 'Group By' are the aggregates if include all rows is not selected.

    As I want the record that has the max value for a field in a group, I enabled 'Include all rows'. (if multiple record in the group have the same MAX value then the first one should be returned. The problem that I am facing is that I dont know how to differentiate the rows. The document states :

    Include all rows: Check this if you want all rows in the output, not just the aggregation. To differentiate between the 2 types of rows in the output, we need a flag in the output. You need to specify the name of the flag field in that case. (the type is boolean)

    Where do I specify the name of the flag field. Is there an example that I can look at ?

  2. #2
    Join Date
    May 2006
    Posts
    4,882

    Default

    I'd have to check... from memory it's either the one or the other, so no reason for an extra field. Documentation sometimes can be wrong.

    Regards,
    Sven

  3. #3

    Default

    I only want the row (all fields from the input) that has the maximum value for the field. Is that possible ? If all rows are included on the output how do I know which one has the maximum ?

  4. #4
    Join Date
    May 2006
    Posts
    4,882

    Default

    They will all have the maximum ... filter on where the field you want == the new field (with the maximum).

    Regards,
    Sven

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.