Appending data in a column from new table into existing table without any joins

Hello there,

I seek support in transforming this table. As shown in the image, I am having “Table A” and “Table B”.
Each table is independent to another and there is no join at all.
Now as shown in the bottom picture, I need to copy the values from Table B and paste it in Table A repeatedly until all the rows are filled.

could any one suggest of proceeding this further!!

Regards,
Neelima

Hi there,

I believe there are multiple ways of doing this but one could be you use Concatenate node on Table B (once or twice depending on the difference between rows in Table A and Table B). Then use Joiner with Inner Join and join on Row ID.

Something like this:
ManipulateData

Try it and if any questions or problems I can make you an example.

Br,
Ivan

2 Likes

Hi @ngumpena, Neelima

I have created a suggestion to create the table you want. appending_data_tables.knwf (47.0 KB) . In this workflow the number of extra rows for table B to match the number of rows for table A is calculated. Then then you can use the Column Apender node and filter for the columns you need.

.
Hope this helps you proceeding this further.

gr. Hans

2 Likes

Hi,

I don’t know why you are doing this, but in case you are just faking or generating data, you could use the Random Matcher. It will just add the second tables column to rows rows from the first column.

https://hub.knime.com/knime/extensions/org.knime.features.datageneration/latest/org.knime.datageneration.randommatche.RandomMatcherNodeFactory

1 Like

Hi Hans,

could you explain me a bit please

Hi Neelima

In my wf, the first step is to find how many rows Table A has more than Table B. That is done with the Extract Tables Dimension and a Math Formula node. These “extra” rows are extracted from Table B (node 1) and added to all the rows from Table B (Concatenate) . Now both tables have an equal number of rows an can be append via the Column Appender. Using the Column Filter you are able to choose the columns you want to use.

gr. Hans

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