Yesterday i shared a topic about @OFFSET function usage in knime. There is a different need that is relative logic with that. I need a row back update like as example flow.
First 4 columns are input columns and i am trying to create last column. Rule is;
if stock is normal and lag of its all phantom stock rows must be derived with normal until i.th lag of stock not equal to phantom partition by store and product else stock=stock_update. Data is below;
Mycase.knar.knwf (4.6 KB)
Regarding the example, the solution is too easy. But there is something I cannot understand in your explanation.
In the example, the stock_update gets changed when the stock is “soos” for the first time and from there the stock_update is always normal. What if there is a “normal” stock before “soos”?
Would you please update your example and consider all potential cases?
Thanks for your interest but there is only one condition if new stock value “normal” and previous is “phantom”, old all “phantom” stocks are going to change as “normal” in same group (in my example:Store,Product).
Maybe, i couldn’t understand your case and if you state the different case clearly, i can update my topic.
OK, got it.
Still no loop?
I’m sorry about that but you got it
OK, sorry for the delay. I just could work on the issue and here is the workflow to do what you ask: (without using loops or codes)
offset2.knwf (36.2 KB)
I have used a Rank node to add ascending numbers for each group (store and product) and then found the max rank for “normal” values in each group by Pivoting. Then I joined the max rank to the main table and used a Rule Engine to change the “phantom” values to “normal” which their rank is lower than the max rank of the normal value.
I hope this is what you want.
Thanks lot @armingrudd,
That’s solution is exactly what i want.
I think partition node is more useful than i think
That’s my 100th solution in the forum. Thank you.
You mean Pivoting, right? The aggregation nodes are really helpful. I think I have to write a blog post about them…
100x congratulations gr. Hans
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.