Merged Row ID in a joiner

Hi
I am very new to Knime. I was joining some tables. While they worked well, row ids on file was merged as well. Any ideas as to how to avoid/correct this? thank you so much.

image

What is the outcome that you’re aiming for?

The default behavior is to concatenate original row IDs for the joined rows. The alternative is to assign new row keys sequentially.

image

I was trying to get some thing like this

Alabama

instead of

Alabama_Alabama

Thanks.

Try the following:

  1. extract the row IDs to a new column using the RowID node
  2. split the values in the newly created column with the Cell Splitter node using underscore as the delimiter
  3. use another RowID node to insert the new RowIDs
  4. delete the unneeded columns
2 Likes

Hi @davidlan

An alternative solution to @elsamuel’s last post is to extract the rowID using the -RowID- node before doing the joining of tables and then use this newly created column to set back the rowID values using an extra -rowID- node.

Please be aware that the rowID values are rowkeys and hence should always be unique. Thus, if you want to conserve as final rowkey, the rowID of only one of the tables, then any row of a table should only match one row of the other table. Otherwise @elsamuel’s method will not work nor mine.

Hope it helps.

Best
Ael

2 Likes

thank you elsamul and aworker for the help. I was hoping that there was a one-click solution but these worked.

2 Likes

Hello @davidlan,

there is a ticket for a one click solution. See here:

(Actually seems like it’s already done for v4.6 - https://www.knime.com/nightly-build-changelog. See AP-17553.)

Alternatively if states are always sorted same you can use Column Appender or if you are only adding one column you can use Cell Replacer node.

Br,
Ivan

4 Likes

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