Create rows based on Cell value

Si imagine I have such table

url | pages

domain.com/thread=12&page=7 | 7
domain.com/thread=5&page=2 | 2

And I want such output, in another table if possible:

domain.com/thread=12&page=1
domain.com/thread=12&page=2
domain.com/thread=12&page=3
domain.com/thread=12&page=4
domain.com/thread=12&page=5
domain.com/thread=12&page=6
domain.com/thread=12&page=7
domain.com/thread=5&page=1
domain.com/thread=5&page=2

Is it possible to do such thing in knime?

Hi @iagovar,

Sure it is possible. See this workflow: create_rows_based_on_cell_value.knwf (53.0 KB) .
gr. Hans

4 Likes

Hi there!

There is One Row to Many which can be used in this case as it will multiply each row by corresponding number from integer column. Then Rank and/or String Manipulation only will do the trick :wink:

create_rows_based_on_cell_value_ipazin.knwf (34.1 KB)

Br,
Ivan

4 Likes

@ipazin that’s a nice one for this!

3 Likes

Hi @iagovar,

In addition to the solutions suggested by @HansS and @ipazin, I have mine as well:

24297-1-1.knwf (17.3 KB)

:blush:

3 Likes

Hey @ipazin,

I agree with @HansS, nice one! :+1:

One Row to Many… Great node!

:blush:

2 Likes

Finally used that node, I didn’t know it existed, sometimes it’s difficult to find info about nodes, forum becomes and indispensable source of information.

2 Likes

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