transfering pivot output with differnet number of columns using vlookup

Dear all,

I have two tables:
Inbound
key
a
b
Outbound
key
a001
b001
a002
b002

a010
b010

Node Inbound Pivot results in 1 row for each key for Inbound:
key
1.0+first(a)
1.0+first(b)
2.0+first(a)
2.0+first(b)

4.0+first(a)
4.0+first(b)

I want to add the columns from Inbound pivot to outbound.
But number of columns in Inbound Pivot can vary (today 4 column pairs, tomorrow 10 column pairs; depening of number of records inbound, but not more than 10.

How can I best transfer the data from Inbound Pivot to Outbound?
e.g.
outbound.a001 = pivot.inbound.1.0+first(a)
outbound.b001 = pivot.inbound.1.0+first(b)
outbound.a002 = pivot.inbound.2.0+first(a)
outbound.b002 = pivot.inbound.2.0+first(b)

outbound.a010 = pivot.inbound.10.0+first(a)
outbound.b010 = pivot.inbound.10.0+first(b)

Is there a node like colum_exist to verfy if a column exists in Inbound?
e.g.
if exist(pivot.inbound.1.0+first(a) then
outbound.a001 = pivot.inbound.1.0+first(a)
endif

Please find workflow attached.

Thanks for help!

BR,

Heinz
test 4 to Knime.knwf (27.7 KB)

Hi again,

I don’t know if you really need to have the “outbound” vlookup.

The result of the pivot node on the most right should have the same structure.

Link to my KNIME hub: https://hub.knime.com/s/GUn16yfiWWcBggqx

Hi ActionAndi,

thank you very much for your answer, but I still see some issues:

  1. At the end of the workflow pivot data from inbound should be appended to outbound.
  2. Outbound must have the following structure with all 21 fields independed how many fields result from pivot inbound

outbound structure:
key
a001
b001
a002
b002
a003
b003

a010
b010

After node value lookup you can see outbound with the correct appended columns from pivot; this works fine.

But I do not know you to transfer these result columns to the above named fields because the number of appended fields from inbound pivot can vary from 1-10 for column a and b.

In the node outbound result I have manually created the result table I need for my example workflow.

Maybe you have another idea?

Thanks in advance!

BR,

Heinz
test 4 to Knime.knwf (29.8 KB)

Ah, now I got it. You want to have exactly the same columns like outbound :slight_smile:

Quick and Dirty:

If outbound holds some data as well, a “concatenate” would work also.

Thank you very much for help!

BR,

Heinz