Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: counting a field in a row

  1. #1
    Join Date
    Jul 2010
    Posts
    8

    Default counting a field in a row

    I think the following must be possible but i don't see the solution. Supose you get some fields where the last field is a string with the following values row1 'AAA' row2 'AAA' row3 'AAA' row4 'BBB' row5'BBB' row6 'CCC' row 7 'DDD' row8'DDD'...
    How can add a field that counts untill the last field changes. So that we get row1:1 row2:2 row3:3 row4:1 row5:2 row6:1 row7:1 row8:2
    Sometimes it's only a few times but it can be more than 50 times...

    WaveX

  2. #2
    Join Date
    Oct 2007
    Posts
    107

    Default

    Hi Wavex,

    Use the "Add value fields changing sequence" from the "Transform" group to do this.

  3. #3
    Join Date
    Jul 2010
    Posts
    8

    Default

    Thanks CHamel !
    Seems to be working in 4.0. Anybody knows if this is easy todo in 3.52 ? Our production environment is still this version...

    WaveX

  4. #4
    Join Date
    Oct 2007
    Posts
    107

    Default

    I think that within this version, you could use the "Group By" step by making sure to check the "Include all rows" and "Add line number, restart in each group" and define your field name in "Line number field name".

  5. #5
    Join Date
    Jul 2010
    Posts
    8

    Default

    This works like a charm .. thanks again...

    WaveX

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.