Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: Dynamic fill

  1. #1
    Join Date
    Dec 2016
    Posts
    1

    Thumbs up Dynamic fill

    Hi guys

    I need your help!!!

    Having this input table.

    item month quantiy
    54000001 1 100
    54000005 1 175
    54000009 1 195
    54000013 1 215
    54000002 2 300
    54000006 2 180
    54000010 2 200
    54000014 2 220
    54000003 3 50
    54000007 3 185
    54000011 3 205
    54000015 3 225
    54000004 4 200
    54000008 4 190
    54000012 4 210

    I want to assign the correct Facility depending of his capacity to produce.

    knowing that:
    Facility 1 has priority to produce over Facility 2, and Facility 2 over Facility 3

    Facility 1 can produce 300 in a month
    Facility 2 can produce 1000 in a month
    Facility 3 can produce infinite

    The pseudo-code should be something like:

    If (Select sum(quantity) where facility=’facility 1’) < 300 then ’facility 1’
    Else If (Select sum(quantity) where facility=’facility 2’) < 1000 then ’facility 2’
    Else ’facility 2’

    The execution of this should works on this way(thinking that is perfectly defined)


    Start process…

    Read 1:
    item month quantiy facility
    54000001 1 100 ?

    Result 1: sum(quantity)=0 where facility=’facility 1’
    item month quantiy facility
    54000001 1 100 facility 1

    Read 2:
    item month quantiy facility
    54000001 1 100 facility 1
    54000005 1 175 ?

    Result 2: sum(quantity)=100 where facility=’facility 1’
    item month quantiy facility
    54000001 1 100 facility 1
    54000005 1 175 facility 1

    Read 3:
    item month quantiy facility
    54000001 1 100 facility 1
    54000005 1 175 facility 1
    54000009 1 195 ?

    Result 3: sum(quantity)=275 where facility=’facility 1’
    item month quantiy facility
    54000001 1 100 facility 1
    54000005 1 175 facility 1
    54000009 1 195 facility 1
    Read 4:
    item month quantiy facility
    54000001 1 100 facility 1
    54000005 1 175 facility 1
    54000009 1 195 facility 1
    54000013 1 215 ?
    Read 4: sum(quantity)=370 where facility=’facility 1’
    Then… sum(quantity)=0 where facility=’facility 2’
    item month quantiy facility
    54000001 1 100 facility 1
    54000005 1 175 facility 1
    54000009 1 195 facility 1
    54000013 1 215 facility 2
    .
    .
    .
    .
    .

    Finally my result table is:

    item month quantiy facility
    54000001 1 100 facility 1
    54000005 1 175 facility 1
    54000009 1 195 facility 1
    54000013 1 215 facility 2
    54000002 2 300 facility 1
    54000006 2 180 facility 2
    54000010 2 1000 facility 2
    54000014 2 220 facility 3
    54000003 3 50 facility 1
    54000007 3 185 facility 1
    54000011 3 205 facility 1
    54000015 3 225 facility 2
    54000004 4 200 facility 1
    54000008 4 190 facility 1
    54000012 4 210 facility 2

    I hope you understand

    How can I solve this in kettle?????

    Thanks in advance.

    Carlos.

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

    Default

    I you calculate the cumulative sum per month you can use step Number-Range to assign facilities.
    This kind of production planning isn't very realistic, though.

    Also, your numbers and pseudo code could be more consistent ...
    Attached Files Attached Files
    So long, and thanks for all the fish.

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.