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.
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.
I was trying to get some thing like this
Alabama
instead of
Alabama_Alabama
Thanks.
Try the following:
- extract the row IDs to a new column using the RowID node
- split the values in the newly created column with the Cell Splitter node using underscore as the delimiter
- use another RowID node to insert the new RowIDs
- delete the unneeded columns
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
thank you elsamul and aworker for the help. I was hoping that there was a one-click solution but these worked.
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
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.