Converting range to List

Hello!, I’m pretty new to knime and I having some challenges. I have 2 columns with lower and upper limit. I now want to convert it to list instead. Can you help me on which node to use?

Sample
Input
Column A Column B
10000 10005
30090 30099

Output:
Column A
10000
10001
10002
10003
10004
10005
30090
30091
30092
.
.
.
.
XXX99

Hello @maiguej and welcome to the Community,

Please find the below workflow that does the job:


Range_to_list.knwf (102.8 KB)

I’m sure there is a more elegant way to do that, but… it simply works :slightly_smiling_face:
Happy KNIMEing,
Kaz

4 Likes

Hi Kazimierz,

Im trying to follow the workflow but I cannot apply it to the data. How can I set the row splitter using the data below? Is it possible to include the 3rd column once it was splitted to list?

|Lower Limit|Upper Limit|PC|
|8011151003|8011151003|CC9999|
|8011157400|8011157409|CC9999|
|8211100015|8211100019|CC9999|
|8211167400|8211167409|CC9999|
|8881000000|8881999999|ON9999|
|9280920870|9280920899|CC9999|
|9280920110|9280920119|CC9999|

Well @maiguej, my solution follows your specification ‘2 columns with lower and upper limit’ and Row Splitter node splits data into 2 sub-set.

Your last post changes expectations to:

  • numerous ranges with lower and upper limit;
  • 3 columns;
  • 3rd column with unspecified content.

To work with numerous ranges, I would apply Extract Table Dimensions node to size the dataset and then loop through data rows using the sequence of nodes following Row Splitter node from my proposed solution. However, I’m not sure what the role of the 3rd column is and how the outcome table should look like.

1 Like

Hi @maiguej

I hope this will help you. Working flow below.

YTD data.knwf (34.9 KB)

2 Likes

Hi @maiguej , in addition it is possible to achieve something similar without using a loop, which will make it significantly faster over a large number of rows

create rows from range.knwf (88.7 KB)

4 Likes

Thanks for the help @prashant7526

Thanks @takbb . It works!

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