Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: Cumulative Sums

  1. #1

    Default Cumulative Sums

    Hi folks,

    I'm new to this forum and Kettle (currently evaluating the Kettle tools for some ETL tasks). Now I'm stuck with a probably common problem.

    I need to calculate a cumulative sum grouped by certain attributes,

    As for example given a table with years, months and a value like this:
    year, month, value
    1,1,10
    1,2,15
    2,1,100
    2,2,20
    2,3,15

    I need the following result:
    year, month, value, result
    1,1,10, 10
    1,2,15, 25
    2,1,100, 100
    2,2,20, 120
    2,3,15, 135

    Does someone know how to solve this problem in Kettle (I need a solution, that performs nicely, since these calculations have to be done for rather huge tables), the Group By component AFAIK doesn't do it.

    Thanks in advance for any hint,
    Christian

  2. #2
    Join Date
    Nov 1999
    Posts
    9,729

    Default

    It's a typical reporting problem, not really related to ETL.
    However, you could probably do it with a small piece of JavaScript.

    As I mentioned, it's not really common. You are the first to ask for it on the forum, and we have close to 15.000 messages on it ;-)

    Don't forget to file a feature request for it. It's probably not that hard to add it to the "Group By" step.

    All the best,

    Matt

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.