I’m new in Knime, i was using SPSS Modeler but now i need to transform my flow to Knime. In SPSS Modeler, there is a useful function(@OFFSET) to take lag and update old value and calculate again. For example;
there is a column named x(volume) and its values are 1, 0, 3, 0, 0, 0 and i want to create y(how many days have no sales) column as; 0,1,0,1,2,3. It means if x>0 y=0; else y starts with 1 and increases +1 while x=0
Notes: I have millions of data and don’t want to use python because it is very slow owing to taking data on its platform. Also, i don’t want to use loop in Knime because i have 6000 partition(like stores) and lots of date.
I know it is too much Fabien, but the project must be work daily and there are lots of stores, other alternatives take long time. i havent tried only java snipped and i am going to look at your flow. I found a presentation below which includes these function in knime whislist. I have thought maybe it could has been developed.
Then if you can connect via the database via knime using the db nodes, you could do it as a query if your database allow the windowing functions. You will avoid the time to transport your datas from the database to Knime in that case.
Thanks both of you. It will be useable for my case. I have one more problem and maybe you can help about offset logic in Knime like that a data.
store product date stock stock_1
1 p1 20190101 phantom phantom
1 p1 20190102 phantom phantom
1 p1 20190103 phantom soos
1 p2 20190101 phantom normal
1 p2 20190102 phantom normal
1 p2 20190103 phantom normal
1 p2 20190104 phantom normal
1 p2 20190105 normal normal
1 p2 20190106 soos soos
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 replaced with normal until i.th lag of stock not equal to phantom partition by store and product else stock=stock_1.