Random Number Assigner and Flow Variables


#1

I’m using KNIME 3.5.3 in Windows and when I use “Table Column to Variable” to generate a Flow Variable that I want to use to set a limit for the “Random Number Assigner” node, the latter does not seem to obey the Flow Variable. Under “Flow Variables”, I go to “minmax”, then select “MAX” where I specify the variable from “Table Column to Variable”. However what I get from “Random Number Assigner” reflects instead what was specified for Max - even though at the bottom of the window I see an alert telling me “The MAX parameter is controlled by a variable”. The Flow Variable is being passed as type double.

I also found that if I instead use the node “Random Number Assigner (Apache)” I can use this Flow Variable to set a limit to the random number range.

At this point I’m not sure if this is user error, something peculiar with my installation, or an actual bug. If someone else could try this in KNIME 3.5.3 for Windows that would be great.

thank you


#2

I see the same phenomenon on my Mac


#3

Hi @lparsons42,

I am not entirely sure what the minmax > MAX flow variable sets but it’s definitely not what you are trying to achieve. It might only be there for compatibility reasons and is no longer used.

The node has to be flexible with respect to the categories in the input table, i.e. it generates a row for each category so that you can set a minimum and maximum for each. Hence, the configuration via flow variables is a little more involved: the data is actually contained in the cfg_data_entries and is modelled after the table that you see in the Options tab:

  • cfg_column_0 contains the names of classes
  • cfg_column_1 contains the minima for classes
  • cfg_column_2 contains the maxima for classes

So if you want to change the maxima, you will have to control cfg_data_entries > cfg_column_2 > 0 and cfg_data_entries > cfg_column_2 > 1 by flow variables in a two class scenario. See the attached workflow for an example on how to do that.

11277.knwf (11.4 KB)

Feel free to ask more questions if I was unclear!

Best,
Stefan