The KNIME Expression node enables generic row-by-row data manipulation within KNIME workflows.
Data Access: The expression is evaluated for each row in the input table and the result is stored in the output table. To access table data, you can use the following methods:
$["column name"]
to access the value in the current row of the column with the
given name. When the name does not contain special characters or
spaces, you can use the shorthand notation:
$column_name
.
$["column_name", offset]
to reference previous or next rows relative to the current one.
The offset is a static number. Negative offsets point to previous
rows, positive offsets to rows next the current row. Replacing a
column will only take effect after evaluating the expression for
the whole table. This means that the expression only uses the
original data from that column.
$[ROW_NUMBER]
to get the current row number, starting at 1.
$[ROW_INDEX]
to get the current row index, starting at 0.
$[ROW_ID]
to get the RowID, such as "Row99".
Flow variables can be accessed via
$$["Flow Variable Name"]
, As with column names, you can use the shorthand
$$flow_variable_name
, if the name does not contain any special
characters nor spaces.
Operators :
The expression language supports basic operators, namely arithmetic
(
+
,
-
,
*
,
/
float division,
//
integer division,
**
exponentiation,
%
modulo), comparison (
<
,
<=
,
>
,
>=
,
=
,
!=
), logical (
and
,
or
,
not
), string concatenation (
+
) and a special 'missing coalescing' operator
??
which sets a default value if the left operand is missing.
Functions: The expression node supports a wide range of functions which are available in a catalog on the right side of the editor.
Column Aggregations:
A special set of functions prefixed with
COLUMN_
calculate aggregations over whole columns, such as their minimum,
maximum, or mean values, for example,
COLUMN_MIN("Column Name")
. Note that these take a "Column
name" instead of a value from a row
($["column name"]
) as input.
AI Expression Assistance (Labs): If the KNIME AI Assistant (Labs) extension is installed, the button on the lower left of the code editor provides access to AI assisted expression generation and modification. Here you can enter commands in natural language and our expression assistant will replace or modify your current expression according to your prompt. The more precisely you describe what results you expect, the better the results will be. The AI will suggest modifications and show them to you in a diff-view (differences between your current expression on the left and the suggested expression on the right) which you can apply or query another response by entering a new or refined prompt.
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 Expressions from the below update site following our NodePit Product and Node Installation Guide:
A zipped version of the software site can be downloaded here.
Deploy, schedule, execute, and monitor your KNIME workflows locally, in the cloud or on-premises – with our brand new NodePit Runner.
Try NodePit Runner!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 mail@nodepit.com.
Please note that this is only about NodePit. We do not provide general support for KNIME — please use the KNIME forums instead.