Possible to group by non-unique values - a range of values?

Is it possible to group by non-unique values, but rather a range of values, or values with a certain range?

For example, I'd like to group the following non-unique values in a column into one row: 5.1, 5.3, 5.9, 6.3, 6.8. For this example, I'd like to tell KNIME to group numbers that are within +1 or -1 of a value (6 in this example). So in essence, I'd like it to group numbers that are within a certain value range (so within 2 integers for example). Is it possible to do this?

Thanks in advance.

Sure, just create a new column with for example the following formula:

floor(($yourCol$ + 1) / 2)

or

round($yourCol$ / 2)

This will give you 3 for all the above values.

After that, you can GroupBy that new column. (I understand you might want to scale back, so the formula you might want to use is probably: floor(($yourCol$ + 1) / 2) * 2 or round($yourCol$ / 2) * 2)

Cheers, gabor

There are also various Binner nodes which might also be configurable to get your categories correct.

And if your bins are too complicated for a simple formula, then you might need to generate your bin ids in some sort of scripting node (e.g. Python, Java Snippet etc) or Rule Engine node

Steve