Hi,
I need to make the following calculation in Knime:
I tried with Moving Aggregation and Lag Column, but the thing is that I cannot do the multiplication within the moving aggregation. Can anyone help with this? Thanks.
Hi,
I need to make the following calculation in Knime:
I tried with Moving Aggregation and Lag Column, but the thing is that I cannot do the multiplication within the moving aggregation. Can anyone help with this? Thanks.
Can you upload a workflow with some sample data in it? It is also hard to tell what columns you are referencing in your formulas. What are the column names for âFâ and âGâ? Is row 2 in the formula the 1st row with data (aka Number = 6)?
Not sure how to edit the post, but here is the screenshot with the columns:
Super confusing to my eyeâŚ All of the cells referenced in the formula appear to be blank.
It will be much easier to see this in KNIME. You can get an upload friendly workflow file by going to File â Export KNIME WorkflowâŚ Then make sure that Reset workflow is not checked when you save it.
Iâm not really sure what you meanâŚ The first table is how the data looks now, and the second table is what the outcome should be. The column âformulaâ just shows which formulas have been used for each row in column G.
But I have attached the workflow with the data now.
data.knwf (6.7 KB)
Hello @aj05 and welcome to the KNIME forum.
This is your workflow:
Send your column $F$ to variable $${DF}$$
It takes the first row by default
Rule Engine column $factor$:
NOT $F$ = $${DF}$$ => $F$
TRUE => 1
Moving Aggregation $Product$
You can control the window length as variable from a âTable Dimensionâ node (not included)
Math Formula:
$${DF}$$ * $Product(factor)$
BR
First thought of a lag column node but I like @gonhaddock great solution. MA Node for the win.
I had started a lag column solution when this one popped up. Very cool approach. I am going to start looking for opportunities to use the Moving Aggregation node more often.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.