RULE := BEXPR '=>' STRING | NUMBER | COL BEXPR := '(' BEXPR ')' | 'NOT' BEXPR | 'MISSING' COL | AEXPR (BINOP BEXPR)? AEXPR := COL OP COL | NUMBER OP COL | COL OP NUMBER | STRING OP COL | COL OP STRING | COL LOP STRINGLIST BOP := 'AND' | 'OR' | 'XOR' OP := '>' | '<' | '>=' | '<=' | '=' | 'LIKE' LOP := 'IN' STRING := '"' [^"]* '"' NUMBER := [1-9][0-9]*(\.[0-9]+)? COL := '$' [^$]+ '$' STRINGLIST := '(' STRING (',' STRING)* ')'
Rules consist of a condition part (antecedant), that must evaluate to true or false, and an outcome (consequent) that is put into the new column if the rule matches. The most simple rule is a comparison between a column and another column, a fixed number or string. The LIKE operator treats the fixed string as a wildcard pattern (with * and ?) as wildcards, the IN operator compares the column value to a list of strings and evaluates to true if at least one value in the list is equal to the column's value. Note that all operators are case-sensitive!
The outcome of a rule can either be a fixed string, a fixed number, or a reference to another column. The type of the outcome column is the common super type of all possible outcomes including the default label. If the outcome of a single rule or the default label is a reference to a column, please check the corresponding option below the text field.
Columns are given by their name surrounded by $, numbers are given in the usual decimal representation. Note that strings must not contain double-quotes.
Rules can (and should) be grouped with brackets because there is not pre-defined operator precedence for the boolean operators (comparison operators always take precedence over boolean operators).
Some example rules:
$Col0$ > 5 => "Positive" $Col0$ = "Active" AND $Col1$" <= 5 => "Outlier" $Col0$ LIKE "Market Street*" AND ($Col1 IN ("married", "divorced") OR $Col2$ > 40) => "Strange" $Col0$ > 5 => $Col1$
You want to see the source code for this node? Click the following button and we’ll use our super-powers to find it for you.
To use this node in KNIME, install the extension KNIME Base nodes from the below update site following our NodePit Product and Node Installation Guide:
A zipped version of the software site can be downloaded here.
Do you have feedback, questions, comments about NodePit, want to support this platform, or want your own nodes or workflows listed here as well? Do you think, the search results could be improved or something is missing? Then please get in touch! Alternatively, you can send us an email to firstname.lastname@example.org, follow @NodePit on Twitter, or chat on Gitter!
Please note that this is only about NodePit. We do not provide general support for KNIME — please use the KNIME forums instead.