Hub
  • Software
  • Blog
  • Forum
  • Events
  • Documentation
  • About KNIME
  • KNIME Hub
  • Nodes
  • Math Formula (Multi Column)
NodeNode / Manipulator

Math Formula (Multi Column)

Manipulation Column Convert & Replace Streamable
Drag & drop
Like
Copy short link

The Math Formula (Multi Column) node is an extension of the Math Formula node which evaluates a mathematical expression based on the values in a row for a set of selected columns. It allows the user to do with a single node what would otherwise require multiple nodes. If you wanted to evaluate the same expression for more than one column with the Math Formula node, you would need to string several Math Formula nodes together. For these cases, the Math Formula (Multi Column) allows you to write a formula that refers to the current column in a set of selected columns.
E.g. to add 1 to the values of columns A, B, and C, you would select columns A, B, and C and enter the formula " $$CURRENT_COLUMN$$ + 1 " into the Expression editor.
The computed results can be either appended as new columns or be used to replace the selected input columns.
Available variables to use in the expression are the values in the corresponding row of the table (left list in the dialog).
Commonly used functions are shown in the list "Mathematical Functions". There are also some constants available, such as pi (the ratio of the circumference of a circle to its diameter), e (the base of the natural logarithms), the total number of rows in the table, and some other column based constants ( constant category of functions).

This node uses JEP , the Java Math Expression Parser .

Column based constants such as COL_MIN(col_name) will be calculated in advance (if necessary).

You can reference the integer flow variables like this: $${IflowVar}$$ , the floating point flow variables like this: $${DflowVar}$$ .

The set of selected columns can be referenced using the CURRENT_COLUMN placeholder which looks like this: $$CURRENT_COLUMN$$ . In each iteration of the node (looping over the set of selected columns) this placeholder will be replaced with the column name from the current iteration. It doesn't work for columns which contain dollar signs in their name.

Reference the columns with the form: $colName$

When any of the used columns contains a missing value, the result is missing, just like when the result would be NaN, infinite value, or outside of the 32 bit signed integer range when that is requested.

NaN values act as value true in boolean expressions and compared to anything (including NaN) in any way (including ==, but not !=, which is like !(... == ...)) is false (0).

Please note the expressions are case sensitive.

Node details

Input ports
  1. Type: Table
    Input data
    Any input data
Output ports
  1. Type: Table
    Output data
    Input data amended with math column.

Extension

The Math Formula (Multi Column) node is part of this extension:

  1. Go to item

Related workflows & nodes

  1. Go to item
    math formula multi columns
    kowisoft > Public > math formula multi columns
  2. Go to item
    20220708 Pikairos Calculate percentage by column
    The -Math Formula (Multi column)- node can be a possible solution to calculate % values p…
    pikairos > Public > 20220708 Pikairos Calculate percentage by column
  3. Go to item
    Column Expressions for Data Manipulation
    ETL Data manipulation Data transformation
    +8
    This is an example worklow to manipulate string values, transform numeric values, and gen…
    knime > Examples > 02_ETL_Data_Manipulation > 04_Transformation > 03_Column_Expressions_for_Data_Manipulation
  4. Go to item
    Unpivot and Split
    tommy > Public > Unpivot and Split
  5. Go to item
    Transform data with One-To-Many and Math Formula
    Transform data with One-To-Many and Math Formula
    mlauber71 > Public > forum > kn_forum_29997_one_to_many
  6. Go to item
    データ操作用の列式
    ETL Data manipulation Data transformation
    +8
    これは、文字列値を操作し、数値を変換します。そして新しい列を生成するワークフローの例です。 1.単一のデータ操作タスクを実行するさまざまなノード 2. Column Expres…
    infocom > Public > 02_ETLデータ操作 > 04_変換 > 03_データ操作用の列式
  7. Go to item
    Linear Regression Weighting
    livinc > Public > Linear Regression Weighting
  8. Go to item
    Forum_Question_Substracting_Columns_Pairwise
    kathrin > Public > Forum_Questions > Forum_Question_Substracting_Columns_Pairwise
  9. Go to item
    Forum_Question_Substracting_Columns_Pairwise
    kathrin > Forum Questions > Forum_Question_Substracting_Columns_Pairwise
  10. Go to item
    Notched Boxplot with ints
    lukass > Public > Snippets > Notched Boxplot with ints
  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
Hardturmstrasse 66
8005 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 Server
© 2022 KNIME AG. All rights reserved.
  • Trademarks
  • Imprint
  • Privacy
  • Terms & Conditions
  • Credits