Calculate A Derivation

Dear KNIME Forum,

I´m currently working with Timeseries and I´m trying to find a comfortable Way to Calculate the derivation of my timeseries.(Means I only want to know the difference from row to row)

I Created the following workflow(see picture). My Idea was to create a LagColumn and substract it from my actual column and it works. The only problem I have is that I have to change it quite frequently and there are a lot of Math Nodes to configure this way.
The Lag Column Part is nicely looped but I have to manually configure each Math node, which is uncomfortable.

If anyone can think of a good way to further automate it or maybe there is a Node I havent found yet, I would be really thankful. I already tried using flow-variables on the math nodes with little success.

Thank you a lot for your help.


Knime_Forum_Question.knwf (25.8 KB)

Hi @oso91 -

Have you tried out the Math Formula (Multi Column) node? Sometimes you can use it to replace a whole series of Math Formula nodes. I don’t know if this would work for your use case or not but it might be worth a try.

For example, here’s a configuration screenshot of performing the same operation on a number of columns, which are explicitly defined in the Exclude/Include dialog.

1 Like

I don´t have it. Is it part of a new Update?

UPDATE: The Math Formula (Multi Column) node is newly available to version 3.5. So you’ll need to update your version of KNIME Analytics Platform to use it. Sorry for the confusion!

Ah ok, thanks for the info Scott!

Solution found without updates/new nodes:

R-Snippet Code:

input <-
knime.out <- data.frame(c(0,diff(input[,1])))

-> the Column Rename Node gets the column name as a flow variable. If you don´t do this, every column will be named “output”


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.