Rule Based row filter - not getting the filter requested

Hi,
I have the raw data attached here.
raw_data.xlsx (3.4 KB) .

I have used the following commands in the Rule based row filter

$NAMES$ = “A” AND $Dist$ =1.598 => TRUE
$NAMES$ = “B” AND $Dist$ =0.735 => TRUE
$NAMES$ = “C” AND $Dist$ =1.598 => TRUE

but still I get is the following output image output_after_rule_based_filter.xlsx (3.3 KB)

I am not sure what I am doing wrong here. Appreciate any help

Thanks
Pio

It looks like you’ve got what you requested. Change TRUE to FALSE and those records will disappear.

Hi @izaychik63
If you look at the raw data - names A appear 5 times for dist 1.598 and C appears 3 times for dist 1.598
image

So according to my rule based filter I should get 5 A’s and 2B’s and 3C’s but instead i gte only 2A’s, B is correct and no C’s.

image

This is what I don’t get

Regards
Pio

Hi @pio

Did you check if there is any white-space trailing the values in your NAMES column?
e.g "A " instead of “A”

Hi @ Hans
I figured it out. When I copied to Excel I can see that Knime had rounded the numbers to 3 decimal places (some of the A’ are 1.598 and others are 1.5981)and that was the reason why my filter wasn’t working correctly.
How Do I turn set the how many decimal places the workflow has to deal with?

Regards
Pio

1 Like

try the Round Double node

3 Likes

Hi there @pio,

KNIME default renderer for Double type is Standard Double which shows 3 decimal places. When you open output table from Excel Reader and right click on Double column, choose Available Renderers and you can change renderer.

Doubleren

To do this in general go Preferences --> KNIME --> Preferred Renderers.

Still this is just renderer and it won’t make you filter data you want in Rule-based Row Filter. You can either follow approach by @HansS and round everything to 3 decimal places or add/modify rules.

Hope this helps!

Br,
Ivan

4 Likes

Thanks @Hans and @ipazin

2 Likes

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