DISTRIBUTE A DATA SET EQUALLY

Hello,

I’m currently creating a process where i need to equally distribute a data set.
Example:
table 1 - contains the ID #
table 2 - contains the data set to be equally distributed by ID
table 3 - output table
sample data

What nodes/functions i need to create such process? Thank you!

Hi @melvinp

See this wf KNIME_project4.knwf (49.1 KB)

It uses the ratio between the number of rows in table 1 and table 2 to create groups of equal size.

See if this works for you.

gr. Hans

2 Likes

Hi @HansS, is there any node similar to column renamer since i dont have that node in my node repository (i might still ask our IT team for an access of that additional node)? :frowning:

I’m currently using KNIME version 4.6.2.
How can i upgrade to the latest version 5.2.0? thank you!

Hi @melvinp

Yes there is:
afbeelding
gr. Hans

1 Like

Got it @HansS :slight_smile: Thank you!

1 Like

Well go to Download | KNIME and download the most recent version. It is no problem to have multiple KNIME versions on your pc. But be sure to install / unzip (zip is what I prefer) your new version in a seperate folder.
gr. Hans

1 Like

modulo 3, groupby modulo column → list, join on row index, ungroup
br

1 Like

Hello @HansS, one more question on this - what will i do here in order for the ID# to reflect on the output table instead of 0…1…2, etc. because there’s a possibility that the ID# needs to be changed and the updated one should also reflect in the out table as shown below. Thank you!

sample data

1 Like

Hi @melvinp

I added 3 more nodes to the wf KNIME_project4-2.knwf (63.7 KB).

So no matter what the value of the ID# is, it will be assinged to the item list. See the result of the final Joiner node.
afbeelding
gr. Hans

2 Likes

Thank you @HansS, that’s perfectly working :slight_smile:

1 Like

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