General summase

@iCFO @takbb Good morning people, everything fine ?

This would be the last point we were dealing with, I decided to open a forum so it wouldn’t be so confusing. And thank you once again for the help you provided me.

But it needs to check if the capacity is empty it takes the value to be sent and adds it to the next day, if the next day is empty it also adds it to the next day.

Every day there must be shipping and CAP, if not, must be added for the next day.

I sent you the material above and I will send you the calculation that should be done.



KNIME_project2.knwf (44.0 KB)

@takbb @iCFO This would be the “challenge” that has been making it impossible for me to continue with automatic programming.

I was trying to do it following the model you made in your post, but I couldn’t understand the logic for creating the variables. I believe it is in the same structure that you did

Hi @Gabriel2020 , can you double-check the above upload as the Table doesn’t reflect your screenshots


thanks

In the print I sent above is an excerpt that presents this “error” and how it should be handled. I put everything in the table I sent, this specific error is in Row 204 onwards

Hi @Gabriel2020 , I don’t follow. The table that you attached in the above doesn’t contain Shipping volume (see my screenshot) It looks like it is corrupted. Can you provide an example with the corrected columns so we know we are both referring to the same values. thanks.

I understood it, I made a cut leaving the cases that appear.

There were 3 logics, which need to be analyzed and addressed.

1st all days are out of capacity => in these cases it may remain empty.

2° Only the last day does not have capacity => In this case, the shipping column needs to be added with the penultimate day if it has capacity, if not, add the two days and add it with the antipenultimate day.

image

3° Among the days of operation, some day does not have a Cap => In this case, simply add it with the next day, if the next one does not have capacity, add it + the day without capacity as the next day that has capacity.

image

And once again, thank you very much for your help, I don’t know how to thank you. I can’t even ask for this help, but I really have no alternatives. Thank you very much !

KNIME_project3.knwf (27.0 KB)

Hi @Gabriel2020 , I want to help, but I only have time to dip in and out, and I still don’t feel I fully understand the exact problem.

Take the example few rows

# shipping receiving
1 4149 5000
2 3434 ?
3 1475 6000
4 1000 ?
5 4070 ?
6 5110 6000

From your screenshots I believe you want it to show the following:

# shipping receiving Calculate
1 4149 5000 4149
2 3434 ? 0
3 1475 6000 4909
4 1000 ? 0
5 4070 ? 0
6 5110 6000 10180

I get that on line =1, 5000 > 4149, so you can send 4149, but doesn’t the remainder (5000 - 4149) = 851 get “carried forward” as available and added to the 6000 on line #3? Do you really just “lose” the balance where you have more “available” than “shipped” in line #1 ?

And what is now the rule where “receiving” < “shipping”?

Anyway, ignoring my questions above, if what you now want is simply the combining of Shipping Volumes where the Receiving Capacity is missing, the attached does it. I’ve done a java snippet version, and also an alternative using a couple of components that can assist. Internally some of my components use Java Snippets which have been packaged up to become no-code options:

I’ve marked the components in red, and they can be found on the hub.

Java Cumulative Calc.knwf (141.6 KB)

2 Likes

Thank you, I’ll check here at work today, it’s very busy.

But basically that would be it, my biggest concern is when my shipment exceeds my capacity, if my capacity is greater than my shipment it is not cumulative, it is only for the day, unlike my shipment volume which is stuck at my distributor.

I will test and get back to you, thank you.

1 Like

@takbb It was perfect, only the 2nd case that gave an error was the one I sent the printout, you can check that the last day does not have capacity, in this case it should be added to the previous day.

However, it is added to the day after and it would not be the same operation, is it possible for us to adjust it?

image

1 Like

OK @Gabriel2020 , glad it’s getting there. I’m not at the pc for remainder of today so I’ll take a look again in the morning.

Agreed, I’m waiting. Thanks for the help once again

Hi @Gabriel2020 , when you say “last day”, do you mean last day for a particular “destiny”. I wasn’t taking any of those other columns into account with that cumulative calc.

So for example here, should it really be adding the 1 to the 3891? as they are different destinations:

Likewise here, should the HUB-PAR-01 values be separate from the HUB-QHB-01 value?

Because if that’s not the case, then why do you consider this one to be the “last day”?

Maybe you explained this in the other post, or maybe I’ve missed it somewhere in this thread, but I think I need to clearly understand what all the rules are in order to assist with this last bit.

The rules may be obvious to you, but please assume that I know nothing about your data (because I don’t actually know anything about your data :wink: )

2 Likes

Good morning everything is fine ?

The last day needs to be considered according to origin and destination, let’s say that the combination of these values ​​creates a unique key that will not be repeated.

For the case of STS-02 (first print) it would be empty because it does not have any days and would already enter that logic that we set up previously.
BAU-02 (First print) already combines the value of 2023-10-09 with 2023-10-10, which is correct because origin and destination are the same and it is the next day.

The same goes for values ​​HUB-PAR-01 and HUB-QHB-01, they must be separated and PAR-01 must be completely empty, (it already enters the logic that you set up previously) and QHB-01 adds up to the next day.

PPE-01 on 2023-10-14 it does not have capacity, and it does not have a next day, so it must be added to the previous one.

Is it clearer?

You can let me know if you have any questions, but it needs to be separated by “groups” that have the same origin and destination.

To avoid polluting this post and it’s huge, you can go back to topic 6 and I showed the 3 logics with print. These are exactly the cases.

It will need to be grouped by week as well as Origin and Destiny for the calc to work on a larger multi-week dataset.

1 Like

thanks @iCFO . I haven’t incorporated the “week grouping”, but I’m guessing that is where you ended up heading on the other thread. I thought I’d uploaded this though. Perhaps the week groups can be incorporated back in relatively easily? I may be returning the favour and asking you for your assistance on working that back in here… :wink:

@Gabriel2020 , please take a look at the attached. I decided to ditch the java snippet that I posted before and instead make use of the alternative which uses components (which contain java snippets) to do the job. This way, I could then more easily add the refinements. The grouping of source and dest is performed by a group loop which increases run time but simplifies finding the groups, and allows the existing nodes to be used. I then added the piece on the end which “adds back” the values from the rows with no “next day” for that group, onto the final “good” day for the group.


Cumulative Calc Shipping.knwf (131.2 KB)

2 Likes

I used the Rank node to simplify grouping into a single field variable. I will see if I can combine that approach with yours, so that grouping can easily be adjusted outside of your Java snippet calcs. I have been meaning to learn some of your Java snippet magic anyways!

1 Like

Cumulative Calc Shipping.knwf (886.4 KB)

Since you were using a Group Loop it was super quick and easy to do the grouping. See if this is the output @Gabriel2020

2 Likes

Nice one @iCFO, I definitely had not clocked all details of the additional week-related stuff. Hopefully this all now meets @Gabriel2020 needs, or soon will! What teamwork! :slight_smile:

1 Like

What would be really cool would be for you to do a “Java Snippet - Master Class” webinar that highlights some of these use various cases, statement syntax, settings and performance advantages. Maybe a “Python - Master Class” webinar from @mlauber71 as well? What do you think @ScottF ?

2 Likes