I have some experience in Knime and in programming.
I use a loop in which my data are treated successively depending on their id. It may occur that an id can't be treated because the table is empty. Rather than to continue the loop, I have an error!
I'd like to say Knime:
-if the table contains data then do the job
-else change the id.
Maybe I'm wrong, but it seems it's hard to manage error in Knime. I've try with the "Rule engine" node, but even if I can write a condition, I can't do what I want...
I accept any suggestion.
You say the table is empty.
In what sense, it has no rows, or it has rows but with missing values in all the cells ?
You should be able to address the problem one way or another.
One way is to build a rule with the Rule Engine node or Maths Formula node to give a new column with a 0 for no data and a 1 for data. Then convert this column to a variable with TableRow to Variable. Now connect this and the data upto a CASE Switch node, and use the newly defined variable to choose which out port of the CASE node is active. 0 will enable the top out port, 1 will enable the second out port.
So then have all your nodes for data manipulation attached to the second outport. Finally connect to this the End CASE node, also connect the top outport from the CASE Switch node to the End CASE node. Finally after the End CASE node have your Loop End node.
So basically now the data will take two paths;
if no data, it will go out off the top CASE switch outport and then proceed immediately to the End CASE node and then the loop end.
if data, it will go out of the second CASE switch outport, and then go through the nodes for data manipulation and then finish at the End CASE node and then the loop end.
Hope this helps.
Hi Simon (always here to help me )
As you may think, this problem is caused by the loop you help me to create yesterday. I didn't thought that for some mol_id, I wouln't have any data. When I say any data, that means that there's no row in the table.
I tried the "rule engine" node but I did'nt find a way to tell if the table is empty then, in your case, add a column of 0.
You could use the "Missing Value" node where you can replace an empty cell with a value or string. i.e. you could get it to fill the contents with the term "NoData".
Then use the Rule Engine node to create a new column, based on
$column name$="NoData" and in the outcome put 0, and as default value put 1.
Is this good for you.