I'm a beginner with knime. I have the following problem:
there is a table, I want to multiply with a faktor (wich, right now is in a table with only one column and one row). The table is a Pivot-table and looks like this:
Types Valueclass 1 Valueclass 2 Valueclass3
Typ A value1a value2a value3a
Typ B value1b value2b value3b
Typ C value1c value2c value3c
I simply want to multiply every value with the factor. Is there any way to do this?
if you only have 3 columns, I would just the "math node" three times, with the factor as a workflow variable so you can just do "$Valueclass1$ * workflowvariable"
If you have more columns, you could create a loop over the columns...
I have 8 columns, so Math node is not really an option.
A loop is a good idea. Is it possible to input the factor within the loop? because the factor I use is computed in knime and I have to be able to update it. So I can't just type it in the Math-node.
I've been looking for other solutions and (because I know R a bit) I used the R Snippet, with the following code (I added the factor as a column in a join before the R Snippet):
One more question: How do I use the column rename (regex) node? I know I need it, to rename the columns to be able to use the math node multible times. But somehow I'm not able to change the full name of the column. All I can do is change the parts, that are the same in the column names anyways:
Well, I don't think you need to change anything in that node. As it is in the example, it has some "dummy" column name in the "Search string (regexp)" field ("Universe_0_0")'; in fact, that field is controlled by the workflow variable "currentColumnName" which is spit out by the "Column List Loop Start" node.
So, for each column in the "TOP" part of the "Column splitter" node it will rename the column to "ANONYMOUS_COLUMN" just for the sake of the "Math formula" node and then it will rename that column to its original name...