Icon

m_​001_​split_​data

Splitting given data into n equal parts using random numbers

I built this workflow that takes some data, uses random numbers to sort them and then split hem into a given number of parts and store them in KNIME tables. Still wondering if there is an easier way.

You could also combine an iteration of the Partitioning node.

https://forum.knime.com/t/splitting-data-into-parts/13056/4?u=mlauber71 Splitting given data into n equal parts using random numbers new_id=> originalsorting0 to v_no_partsroundto integerlist sort_id=> random sortingv_no_partsjoin part 0 and the highest numbercheck the distributionof the clusterscreate random numberssort by random numbercreate pathselect groupSTARTwrite tableENDData Generator Java Snippet(simple) Normalizer (PMML) Math Formula GroupBy Java Snippet(simple) Integer Input(legacy) Rule Engine Pivoting Quasirandom SequenceGenerator (Apache) Sorter Java EditVariable (simple) Rule-basedRow Filter Table Row ToVariable Loop Start Table Writer String to Path(Variable) Variable Loop End https://forum.knime.com/t/splitting-data-into-parts/13056/4?u=mlauber71 Splitting given data into n equal parts using random numbers new_id=> originalsorting0 to v_no_partsroundto integerlist sort_id=> random sortingv_no_partsjoin part 0 and the highest numbercheck the distributionof the clusterscreate random numberssort by random numbercreate pathselect groupSTARTwrite tableENDData Generator Java Snippet(simple) Normalizer (PMML) Math Formula GroupBy Java Snippet(simple) Integer Input(legacy) Rule Engine Pivoting Quasirandom SequenceGenerator (Apache) Sorter Java EditVariable (simple) Rule-basedRow Filter Table Row ToVariable Loop Start Table Writer String to Path(Variable) Variable Loop End

Nodes

Extensions

Links