Skip to main content Skip to complementary content
Close announcements banner

Math processor

Performs calculations on numbers.

The Math processor allows you to perform calculation operations on fields containing numbers. You can compute and calculate values within a field, as well as between fields.

Usage

The Math processor requires one input flow and can generate only one output flow.

Properties

Properties to configure to compute or calculate values from fields.

Configuration
Property Configuration
Function name
  • Add, subtract, multiply, and divide: Performs an operation/calculation on the field with another field or with a fixed value: Add/sum (+), multiply (x), subtract (-), or divide(/).

  • Modulo: Calculates the remainder of a division operation.

  • Absolute value: Calculates the absolute value for all the numeric values in the field.

  • Negate: Negates the field numbers.

  • Min: Compares with another field or a constant and returns the smallest value.

  • Max: Compares with another field or a constant and returns the largest value.

  • Base 10 Logarithm: Computes the base 10 logarithm from the field.

  • Natural logarithm: Computes the natural logarithm from a field.

  • Exponential: Calculates the exponential of the field numbers.

  • Power: Multiplies to the power of another field or a constant.

  • Square root: Calculates the square root of the field numbers.

  • Cosine: Computes the trigonometric Cosine from the field.

  • Sine: Computes the trigonometric Sine from the field numbers.

  • Tangent: Computes the trigonometric Tangent from the field numbers.

Fields to process

Select the field or fields on which you want to apply a function in the list.

Tip noteIf you want to apply the same function to multiple fields at once, click the Open dialog. Open dialog icon to open a tree view that allows you to select multiple fields.
Create new field Enable this option to create a new field after applying the function. If you do not enable this option, the existing field will be kept and modified.
Rename new field Give a custom name to the newly created field.

To rename the processor or edit its description, click the Edit Edit icon next to the processor name in the Properties panel.

Example

The data used as source in this example contains data about sales to different customers with details on costs, prices, and number of units sold.

Dataset with the number and price of orders

However, it is missing important information that could be used in analytics apps, namely total cost, total revenue and total profit. Using the Math processor you can calculate these numbers by performing operations between columns.

Calculating these three figures will require three processors since only one operation can be performed by a processor:

  1. The first processor will be used to multiply the number of units sold by the price of an unit to calculate the total revenue. Select the Add, subtract, multiply, and divide function and Units sold as field to process. Choose x as operator, and use Unit Price as second field to use. Select the Create new field checkbox, and name the new field Total_revenue.

  2. Then, the second processor will be used to multiply the number of units sold by the cost of an unit to calculate the total cost. Select the Add, subtract, multiply, and divide function and Units sold as field to process. Choose x as operator, and use Unit Cost as second field to use. Select the Create new field checkbox, and name the new field Total_cost.

  3. Finally, the third processor will subtract the total cost from the total revenue to obtain the total profit. Select the Add, subtract, multiply, and divide function and Total_revenue as field to process. Choose - as operator, and use Total_cost as second field to use. Select the Create new field checkbox, and name the new field Total_profit.

A data flow with math processors to calculate total profit and cost

Running the data flow will create three new fields with the results of the calculation in the target, and allow you to analyze the data further.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!