Hub
Pricing About
  • Software
  • Blog
  • Forum
  • Events
  • Documentation
  • About KNIME
  • KNIME Community Hub
  • Nodes
  • Rule-based Row Filter (Dictionary)
NodeNode / Manipulator

Rule-based Row Filter (Dictionary)

Manipulation Row Filter Streamable
Drag & drop
Like
Copy short link

This node takes a list of user-defined rules and tries to match them to each row in the input table. If the first matching rule has a TRUE outcome, the row will be selected for inclusion. Otherwise (i.e. if the first matching rule yields FALSE ) it will be excluded. If no rule matches the row will be excluded. Inclusion and exclusion may be inverted, see the options below.

Each rule is represented by a row. To add comments, start a line in a (condition) cell with // (comments can not be placed in the same line as a rule). Anything after // will not be interpreted as a rule. Rules consist of a condition part (antecedent), which must evaluate to true or false , and an outcome (consequent, after the => symbol) which is either TRUE or FALSE .

If no rule matches, the outcome is treated as if it was FALSE .

Columns are given by their names surrounded by $, numbers are given in the usual decimal representation. Note that strings must not contain (double-)quotes (for those cases use the following syntax: /Oscar Wilde's wisdom: "Experience is simply the name we give our mistakes."/ ). The flow variables are represented by $${ TypeCharacterAndFlowVarName }$$ . The TypeCharacter should be 'D' for double (real) values, 'I' for integer values and 'S' for strings.

The logical expressions can be grouped with parentheses. The precedence rules for them are the following: NOT binds most, AND , XOR and finally OR the least. Comparison operators always take precedence over logical connectives. All operators (and their names) are case-sensitive.

The ROWID represents the row key string, the ROWINDEX is the index of the row (first row has 0 value), while ROWCOUNT stands for the number of rows in the table.

Some example rules (each should be in one row):

// This is a comment
$Col0$ > 0 => TRUE
When the values in Col0 are greater than 0, we select the row (if no previous rule matched with FALSE outcome).
$Col0$ = "Active" AND $Col1$ <= 5 => TRUE
You can combine conditions.
$Col0$ LIKE "Market Street*" AND 
    ($Col1$ IN ("married", "divorced") 
        OR $Col2$ > 40) => FALSE
With parentheses you can combine multiple conditions.
$Col0$ MATCHES $${SFlowVar0}$$ OR $$ROWINDEX$$ < $${IFlowVar1}$$ =>
    FALSE
The flow variables, table constants can also appear in conditions.

The following comparisons result true (other values are neither less, nor greater or equal to missing and NaN values):

  • ? =,<=,>= ?
  • NaN =,<=,>= NaN

Node details

Input ports
  1. Type: Table
    Input table
    Any data table from which to filter rows
  2. Type: Table
    Rules
    Table containing the rules
Output ports
  1. Type: Table
    Filtered
    Data table with the included rows

Extension

The Rule-based Row Filter (Dictionary) node is part of this extension:

  1. Go to item

Related workflows & nodes

  1. Go to item
    Fast Dynamic Rules
    ana_ved > Public > Fast Dynamic Rules
    ana_ved
  2. Go to item
    rule_based_filter_dictionary
    sahil786 > Public > rule_based_filter_dictionary
    sahil786
  3. Go to item
    Lookups
    wkhan > Public > Lookups
    wkhan
  4. Go to item
    Path Support in Row Filter
    mwiegand > Public > Knime Forum Support > Path Support in Row Filter
    mwiegand
  5. Go to item
    Workflow
    elsamuel > Public > Split Multiple Columns based on One Column's Score > Workflow
    elsamuel
  6. Go to item
    Ensembl API Modules
    khs > Public > Ensembl API Modules
    khs
  7. Go to item
    KNIME Server Log Parsing
    REST API KNIMEServer
    +3
    This workflow parses logfiles created during the operation of KNIME Server. The workflow …
    natanaelhupdata > Public > Log Parser and Usage Reporting
    natanaelhupdata
  8. Go to item
    KNIME Server Log Parsing
    KNIMEServer REST API
    +3
    This workflow parses logfiles created during the operation of KNIME Server. The workflow …
    knime > Examples > 09_Enterprise > 01_Server > 03_Using_KNIMEServer_REST_API > 07_Log_Parser_and_Usage_Reporting_on_KNIME_Server
    knime
  9. Go to item
    KNIME Server Log Parsing
    KNIMEServer REST API
    +3
    This workflow parses logfiles created during the operation of KNIME Server. The workflow …
    rolandburger > Public > KNIME Server > 07_Log_Parser_and_Usage_Reporting_on_KNIME_Server
    rolandburger
  1. Go to item
  2. Go to item
  3. Go to item
  4. Go to item
  5. Go to item
  6. Go to item

KNIME
Open for Innovation

KNIME AG
Talacker 50
8001 Zurich, Switzerland
  • Software
  • Getting started
  • Documentation
  • E-Learning course
  • Solutions
  • KNIME Hub
  • KNIME Forum
  • Blog
  • Events
  • Partner
  • Developers
  • KNIME Home
  • KNIME Open Source Story
  • Careers
  • Contact us
Download KNIME Analytics Platform Read more on KNIME Business Hub
© 2023 KNIME AG. All rights reserved.
  • Trademarks
  • Imprint
  • Privacy
  • Terms & Conditions
  • Credits