This post confused me further…I thought that I was just attempting to fill the null values to prep for the BACKLOG calculation.
Is the CALCULATE column showing me the that the presence of null values means that the existing data below any null values requires replacement with a running sum, and then all null values would become zeros? This would require a completely separate series of tests and Moving Aggregations to prep the underlying data before the BACKLOG series of tests and Moving Aggregations. If so, then this is definitely officially going to win the least efficient workflow I have ever built award.
@takbb Simply incredible, can you tell me where I can learn more about Java within KNIME?
I would like to thank you and @iCFO for your help.
However, I sent a new challenge above, do you know what would be the best way to solve it? basically if the cap is empty it adds to the next day and so on
Now you know why I tagged the Java Snippet master @takbb when things took a turn in the direction of conditional moving aggregations.
I too would like to learn some of this Java Snippet dark magic!
The Backlog start of the week needs to be Monday. Then the calc needs to be grouped on the week, Origin and Destiny.
You could use my workflow and swap your Java Snippet out for my Backlog calc loop to save time if you want.
This last null handling calc is also prime candidate for Java Snippet as well. I could build it in base nodes first if you want something to proof to though. I think that my summary of the calc above is what he is looking for.
Hi @Gabriel2020 and @iCFO … Yes Java snippets are my “go to” solution for specific types of work in KNIME such as cumulative calcs.
To use them obviously basic knowledge of Java syntax is needed but beyond that, it’s simply understanding how the above “trick” works.
And it is a trick, of sorts… Java Snippets access rows one at a time from the top of the take to the bottom, and when processing each row, it can ONLY access the table data from the row currently being processed, which makes it surprising that they can be involved in cumulative calcs… so how is this possible?
Simply put they can also “remember” calculated values that were “left behind” by the previous row, provided the Java variable holding the value is defined in the section marked “your custom variables” which in this case is the “backlog” variable.
If you want to see various examples of this in action, which will hopefully assist with the understanding, take a look at this post that Iwrote a couple of years ago…
In small doses, for specific tasks such at this, basic knowledge of Java Snippets can transform your workflow.
I “discovered” this feature quite by accident. I’d been using KNIME just two months and wrote a Java snippet which had a bug in it and didn’t produce the result I expected. When I investigated further I realised it didn’t reset certain variables with each row. I nearly just shrugged it aside as something to be wary of, and then realised how useful that could be, hence the above post.
incredible, as this post has more than 60 posts. I tagged you in a new post for the “new” challenge that would be to add the values for the next day of the week. When can you help me? Thank you for the teachings and personal help.