Joining columns in loop

Hi

I am trying to join columns in loop but somehow it doesn’t work.

Input table (sample) :

Year;product
2017;x1
2017;x4
2017;x12
2017;x13
2018;x2
2018;x12
2018;x44
2018;x77
2019;x78
2019;x1
2019;x3

Output should look like:

Year;product;Year;product;Year;product

2017;x1;2018;x2;2019;x78
2017;x4;2018;x12;2019;x1
2017;x12;2018;x44;2019;x3
2017;x13;2018;x77

I can do it manually by Row Rplitter each year and then join by Joiner. But when it comes to larger data (more years) it is troublesome.

Anyone have a idea how to do it in loops?

Hi @89trunks,

Use the Loop End (Column Append) node instead.

:blush:

2 Likes

Hello @89trunks,

something like this should work:
GroupLoop

where you need RowID to create new row ids in order for loop end to correctly append data.

Anybody has a better approach to this problem (without a loop)? I was playing with pivoting node but everything I came up with seems a bit too complicated…

Br,
Ivan

3 Likes

Thanks I forgot about it - sometimes simple ideas work best.

1 Like

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