Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: Solution for my Accumulation problem using PDI 5

  1. #1
    Join Date
    Dec 2013
    Posts
    1

    Default Solution for my Accumulation problem using PDI 5

    Hi Everybody,

    i am having the data like below:
    Col1 Col2
    1 100
    2 50
    3 60
    4 80
    5 70
    1 50
    2 60
    3 110
    4 50

    I want output in the following accumulated way in a table.
    i am not getting any idea how and using which step we can achieve this, please help me regarding this.
    Col1 Col2 Accumulation
    1 100 100
    2 50 150
    3 60 210
    4 80 290
    5 70 360
    1 50 50
    2 60 110
    3 110 220
    4 50 270

  2. #2
    Join Date
    Nov 2008
    Posts
    777

    Default

    This can be done in two steps:
    1. Calculate a group number that increments every time Col1 is 1. The Modified Java Script Value step will work nicely for this.
    2. Use the Group By step with the calculated group number to calculate the "Cumulative sum (all rows option only!)" aggregate type on Col2. This will give back your running Accumulation value for each group.
    pdi-ce-4.4.0-stable
    Java 1.7 (64 bit)
    MySQL 5.6 (64 bit)
    Windows 7 (64 bit)

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.