Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: Aggregate function subtraction

  1. #1
    Join Date
    Oct 2016
    Posts
    24

    Default Aggregate function subtraction

    Hi,
    i have a situation like:
    STREAM->
    A FLAG VOL
    111 1 500
    111 2 300
    222 1 1000


    Table_Target
    A FLAG VOL
    111 1 1500

    I want in Table Target an update of record A=111:
    A FLAG VOL
    111 1 1500 - 300 +500=1700

    It's possible with Java Script Transformation to do:

    while (all_record_processed()){
    Take Stream.Record with same KEY(a) ->difference= Vol (record with flag=1) - Vol(record with flag=2)
    Update REcord with KEY(a) Vol-difference

    }


    Thanks

  2. #2
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    Here's a less shameful way to do it with Kettle
    Attached Files Attached Files
    So long, and thanks for all the fish.

  3. #3
    Join Date
    Oct 2016
    Posts
    24

    Default

    what is difference from SUM and Cumulative sum (all rows option only!)?

  4. #4
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    Just compare and see.
    So long, and thanks for all the fish.

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.