help with line edits. transfer the next row into a different column

Hi;
As in the example in the picture, transfer the next row into a different column. I want to learn the next row in each row in a different column next to the previous row. How can I do it ?

Hello @umutcankurt

This can be easily done with “Lag Column” node as shown in the following images :

Lagged_Column_by_One

This is doing a forward lag. So you would need first to reverse the table, do a “Lag Column” and then reverse the table again.

Otherwise you can also use the “Moving Aggregation” Node which is a much more powerful node.

Moved_Column_by_Minus_One

You can find a more elaborated example at :

Hope all this is of help.

Best regards

Ael

2 Likes

Hi; @aworker
thanks for the answer is a useful link but not the solution i want.
I want to make a new column by taking each next row to a different column. Meanwhile, I want to remove the rows in the newly created column from the old column.

Hi @umutcankurt

I see now. You want to keep one row every to rows in the column, starting from the first one. Definitely it is not the same problem :wink:

Could you please upload a minimalist workflow with the table. I’ll provide you with the solution in the same workflow.

Best

Ael.

I added the sample workflow.

KNIME_project.knwf (1.5 KB)

The workflow seems empty. Could you please check the content of the workflow & upload it again ?

Hi @umutcankurt,

You can use the Lag Column node having “skip initial incomplete rows” checked and “skip last incomplete rows” unchecked:

lag

Then you can use the Row Filter node to filter odd rows (0 indexed). To make it easier, you use the Counter Generation node after the Lag column node and then use this regex to filter rows:

\d*[13579]$

Here is an example workflow:

22545-1-1.knwf (72.9 KB)

:blush:

2 Likes

KNIME_x1_project.knwf (654.3 KB)

KNIME_x1_project.knwf (633.8 KB) (modified)

:blush:

1 Like

Hi Armin @armingrudd Hi; @aworker

Thank you both very much. He was very educative about the solution method.

:+1: :+1: :knime: :wave:

2 Likes

Hi there @umutcankurt,

you can also utilize mod() function from Math Formula on ROWINDEX followed by Rule-based Row Splitter and Column Appender nodes. Seems clearer and more intuitive to me.

KNIME_x1_project_ipazin.knwf (682.6 KB)

Br,
Ivan

2 Likes

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