adding n columns after pivot

test.knwf

Dear all,

I am executing pivot node as shown in attached workflow.

Depending on datarows before pivoting I get more or less pivot colums as a result:

1 first(a)

1 first(b)

2 fist(a)

2 first(b)

3 first(a)

4 first(b)

I have to add several columns, so that there are always 20 sets, eg.

…

19 first(a)

19 first(b)

20 first(a)

20 first(b)

Is there an comfortable way to add these additonal columns when then do not exit; maybe with a loop.

Please see below pseudocode I have in mind:

for i = 1 to 20

if column i first(a) not exists

create colum i first(a)

create column i first(b)

endif

next i

Any idea?

Thanks for help!

BR,

Heinz