Mathematics DAC
The Mathematics dynamic advanced command is part of the variable commands. Use this command to perform basic calculations (addition, subtraction, multiplication, division, or modulus) using constants and/or values copied from other variables. Drag it into a wizard from the Advanced commands view in the Nintex Wizard Editor to use it.
Before you begin:
Learn how to navigate the Nintex Wizard Editor of the Studio.
Understand how to create wizards and use advanced commands.
Understand variables.
Learn how to customize error handling within an advanced command.
Understand how to configure wizard fallbacks.
Use this command as an internal counter for wizard runs or to perform various numeric calculations such as:
-
Addition
-
Subtraction
-
Multiplication
-
Division
-
Modulus (to get the remainder of a division)
This command is useful in scenarios where you need to perform calculations to drive further actions in your automation. Examples include:
-
Calculating totals
-
Updating prices
-
Managing numeric data
In the Nintex Wizard Editor, search for the Mathematics command and drag it into your steps. Use the table below to configure each field and understand the settings:
Field | Description | What to do |
---|---|---|
First value | The first value or variable to use in the calculation. |
Enter a numeric value, select an existing variable (e.g., $MyVar$), or create a new variable. Ensure values entered in the command are numeric. If one or both of the values entered is non-numeric, the wizard will return an empty result in the variable you have specified. (Numbers that include currency symbols are treated as non-numeric.) |
Operation | The mathematical operation to perform between the two values. | Select the operation you wish to perform: + (addition), - (subtraction), * (multiplication), / (division), or MOD (modulus). |
Second value | The second value or variable to use in the calculation. | Enter a numeric value, select an existing variable (e.g., $MyVar$), or create a new variable. |
Result variable | The variable to store the result of the calculation. | Enter the name of the variable to store the results. You can use a new or existing variable. |
Follow these best practices when using the Mathematics command:
-
Validate variable types before performing calculations using the Check Type command.
-
Back up original data before bulk updates or calculations to prevent data loss or corruption.
-
Build and test each calculation step by step.
-
Test calculations with the View variable list command to ensure accurate expected results.
This example shows how to add the number values of two variables and save the result in another variable.
-
Add the Set value command to your wizard to set up the initial variables.
-
Add the Mathematics command and complete the following fields:
-
Enter the variables created in the Set value command.
-
Select the + operation.
-
Create a variable for the sum.
-
-
Use the View variable list command to verify the results.
The following video provides guided instructions on how to use the Mathematics command: