I am developing a custom node where I need to do mathematical operations on values of 2 columns of 2 different tables.
For example, if I have 3 columns in Table1(C1,C2,C3) and two columns in Table 2(D1,D2), I need to do ((C3+D2)*100)=50. If this is true, then data of Table1 complying to this will be written in a new table which is the output.
Is making a new node essential to your needs. You could easily do this with existing nodes.
combine the tables with joiner node.
then use maths formula node with your formula. Use the IF operator to specify a 1 or 0 as a result for whether it equals 50 or not.
then row filter on this result column for when output is 1.
then use reference row filter of this table as reference versus table1 for inclusion. You are now left with table1 results which matched your criteria.
Yes, making a new node is required because apart from this, I have other requirements also in the node. Can you tell me how can I get the source code of Math node?
Download the KNIME SDK and update the KNIME SDK via the update site including the sources for the Math node. Create a new plug-in via New > New KNIME node extension and make sure you have an dependency defined in the plugin.xml to the Math node. For further details on how develop your own nodes, see our developer guide.
You need to cast the DataCells to the correct value interface, e.g. DoubleValue or IntValue. Then you can retrieve the primitive type using e.g. getDoubleValue or getIntValue and perform any mathematical operation.