remplacement for cascade of joiners to sort out hierarchy

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)

image
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 in advance for your help.

Hi @davidn, welcome to KNIME Forum

Maybe this wf Hierarchy Cascade.knwf (22.7 KB) brings you closer to an “elegant” solution.
image .
gr. Hans

Hi HansS,

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


and gets me a new column higher level #1
image
then I used the newly created column #1 in the next joiner

up to 9 times if required.
KNIME_project2.knwf|attachment](upload://oM6VG9BRtoNj50oKb6cukigDqT2.knwf) (11.0 KB)

Thanks

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