How to divide a row in multiple?

Hello,

I am new and trying to learn. I have a problem, I want do this but dont know how:

I have a table with:
number name
4 john
And I want:
number name
1 john
1 john
1 john
1 john

I want a solution for this and know new nodes. Please can anyone help me?,

Thank you

1 Like

Hi,

It could be done like in the workflow in attachment : KNIME_project5.knwf (29.4 KB)

3 Likes

Simplest solution that I could come up with that avoids loops:

Screenshot%20from%202019-01-21%2017-31-17

Java code:

Integer[] n = new Integer[$number$];
for(int t=0; t<$number$; t++) n[t] = 1;
return n;

KNIME_project2.knwf (7.5 KB)

3 Likes

It works, thank you very much

1 Like

Thanks for your response, it works.

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