Working with intervals - Rule-based row filter

Hi,

I have a doubt when working with rules, using a rule-based row filter node, where I want to consider intervals (or maybe ranges) for filtering. For instance, consider I have one column named ID and I just want to retrieve the ids that start with A* to C*.

What I’ve been doing is use some filters like the following:

$id$ LIKE “A*” OR $id$ LIKE “B*” OR $id$ LIKE “C*” => TRUE

I want to optimize this, to avoid such huge rules like the one if I consider a larger interval, such as A to G, for instance.

I just want to consider number intervals, as well, even if it requires to convert the values to int.

Here is an example of some data read from a table creator.

[Interval rule based row filter.knwf|attachment]
(upload://pmfyAvOSjuFlU83rmmBI3MsmCZJ.knwf) (6.7 KB)

Thanks in advance!

Gilmar

You can use a simple “lower than” and “greater than” combination in logic And.
So the first example from A to G can be write as
$Id$>=“A” AND $Id$<“H”
Same and simplest solution with numbers!

2 Likes

Or you can use a regular expression like this
[ABCDEFG]+.*

2 Likes

Hi pigreco,

I tested both options and everything worked very fine. For the last one, with regular expression, I used like this:

$id$ MATCHES “[ABCDEFG]+.*” => TRUE

Thank you so much!

2 Likes

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