Hi,
I’m using Knime 4.2.3 and I’d like to know if there is any more elegant alternative to sort out hierarchy in a table.
My table has only two columns and data are presented like below:
|Account|Higher level|
|AA|AB|
|AB|BB|
|BB|CB|
|CB|CC|
I’d like to be able to see all hierarchy levels on the same row like this:
|Account|Higher level|Higher level1|Higher level2|Higher level3|
|AA|AB|BB|CB|CC|
The only way I found uses a cascade of joiners ( see picture below)
I used only 3 level in this example but it can go up to 9. The database contains a lot more rows, and the levels are not sorted out.
Is there any other way to achieve this? I tried with recursive loops, column list loop, but couldn’t find a satisfactory result.
Thanks a lot for your reply. your solution is close but doesn’t entirely cover my need, I’m afraid. It will keep adding each new rows as new column where I need to “lookup” for identical pair. In fact it’s more like account|higher level, then use higher level to find higher level 2, then use higher level 2 to find higher level 3, which is not necessarily in the next row.
So my first joiner is like below