Hi there, I have a table that currently looks like this:
But I want to insert some rows so the output looks like this:
The new rows are values can be hard coded.
I’ve read many posts about inserting new rows but none of them fit the purpose of what I am doing here which seems very simple. I’m quite new to knime, this is only my second post.
If someone can help, that would be great. Thank you.
Let’s say that the rows you want to insert are all in a table that I will call Table 1 with respect to your initial table that I will call here Table 2. The operation one needs to do to “insert” Table 1 rows in Table 2 is a “concatenation” of tables. Hence the -Concatenate- node should do the job
If you need to add single rows every time before or after those already existing in your final table (here Table 2), then you would need to use several concatenate nodes or alternatively use just one within a loop if needed. Please be aware too that the last version of this node allows to increase the number of input ports (the 3 points “…” on the node), so if you have more than 2 tables to concatenate at the same time, then just one -Concatenate- node should do the job.
Thanks for replying so quick. So it looks like the easiest way for me to do this is to create another table with the grey rows and then simply concatenate.
The first image above is an output which resulted from pulling data from a live database so the data in the first table will always change every time I refresh the workflow. The screenshots were just dummy data I quickly popped into Excel because I didn’t want to share confidential data in my Knime output.
I will create a static table in knime with the grey rows to add to the table at the very end then
Thanks again! I thought it was some complex fancy way of doing this but it was quite straight forward.
Use Table creator to “hard code” your Table 1 (the one with the 3 first text rows)
Make sure that when integrating the data in the configuration dialog of the -Table Creator- node, you set too at that time the name of the columns, as follows:
This makes sure that the concatenation is done based on column names, the first Table 1 (hard coded) being the reference table.
Inverse the order on the input port connections: Hard code table (Table 1) should be connected to 1st input port and then Table 2 (your numerical data) to the 2nd input port.
This worked like a charm!! Thank you!! Sorry it took me so long to reply. I had to work on that project and only got a chance now (being in Australia and all)