@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.
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
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.
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.
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.
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 !
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.
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.
@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?
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:
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 )
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.
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…
@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.
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!
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!
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 ?