Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: how to insert group row after each group ?

  1. #1

    Default how to insert group row after each group ?

    for example:

    Region Country Target Actual
    INDIA INDIA 15000 3371
    ANZ Australia 6 13
    ANZ NewZealand 5 88


    expected result:

    Region Country Target Actual
    INDIA INDIA 15000 3371
    INDIA INDIA 15000 3371
    ANZ Australia 6 13
    ANZ NewZealand 5 88
    ANZ ANZ 11 101

    After each group (group by Region), a group row is inserted.

    I can't finish it by Group by step, and I know JavaScript can do it, but it is used for non expert user.

    so what is the most simple method to do this transformation?

    thanks in advance!
    Last edited by jianjunchu; 08-26-2008 at 02:28 AM.
    Jason chu
    Beijing Aofei BI Consulting.
    Web: http://www.pentahochina.com
    Email: jianjunchu@gmail.com

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

    Default

    Split your stream in 2 ... 1 going via a group by and then letting the results of the group by and the original result come together, only caveat is the order which would not be 100% to your liking probably.

    In newer versions you also have something like "include all rows".

    Else it's javascript... you want special things you will need javascript.

    Regards,
    Sven
    Last edited by sboden; 08-26-2008 at 06:26 AM.

  3. #3

    Default

    hello sboden !

    In group by step ( version 3.1 ), some aggregation functions (sum, average,max...) are used in a subject field. but is it possible using some other text or value in stead of aggregation in a subject field?


    example:
    Region Country Target Actual
    ANZ Australia 6 13
    ANZ NewZealand 5 88


    groupby result:
    1. using the value of group field in the Country subject
    ANZ ANZ 11 101

    or

    2. using a static text "TOTAL" in the Country subject
    ANZ TOTAL 11 101
    Jason chu
    Beijing Aofei BI Consulting.
    Web: http://www.pentahochina.com
    Email: jianjunchu@gmail.com

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

    Default

    Only if you don't mind the ordering... do a group by, followed by some "add constant" (total), select values step, and then combining with original input.

    You won't find anything for it in the group-by step (v <= 3.1)

    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.