Skip to main content

How to use Math option in a business rule

There are two functions to using the Math data source option.  One is to perform calculations (Sum, subtract, multiply and divide) between different operators and the other is to set a currency to a n

Updated over 2 weeks ago

There are two functions to using the Math data source option. One is to perform calculations (Sum, subtract, multiply and divide) between different operators and the other is to set a currency to a number type. The setting of a currency to a number type is particularly useful when encountering data type mismatches.

Whenever the Table Lookup, Math or Function option is selected, a modal is displayed giving the possibility of performing one out of four actions:

Math - Selector
  • Create New - to create a new record

  • Select Existing - to reuse a previously created record

  • Copy Existing - to create a new record from copy an existing one

  • Run Existing - to execute the source using a given entered context to retrieve the result

The following math calculation will be used as the example for the screenshots below:

  • (Bonus X Exchange Rate) in USD divided by 12.

This example consists of a "High Level Math function" which uses a second Math component, and this uses a Function component. First select Math as an option:

Adding Math Component
Adding Math Component.png

For this example, we will be creating one from scratch. Select Create New option from the Math selector

The Math modal is displayed. Fill out the Name, Description and Currency. To create the logic, (Bonus X Exchange Rate) in USD divided by 12. A Fixed Value of USD can be selected in the Currency Field. In the Math Operation section, the first operand will be reserved to calculate the Bonus Amount (Bonus x Exchange Rate). Select division "/" operator after it and for the second operand, enter a Fixed Value of 12.

Adding Math Component - Add Details

For the first operand, select Math and create the second Math component.

Adding Math Component - Add Math Details

This second Math component will be used to calculate Bonus x Exchange Rate.

Enter a name, select Money as the Output Type and Currency as USD. In the Math Operation section, select the Field for the bonus amount and the multiply "x" operator. The selected bonus amount field can be in any currency. In order to convert the bonus amount to USD, select Function as the second operand. For a more detailed step by step configuration of a function, you can refer to the instructions details in how to use function option in a business rule.

Math - Sample Detail

Return to the Math component and this is how it should look. Click

save button

followed by

close button

. Since this is a match component within an existing component, you may need to click

save button

then

close button

to go back to the Business Rule Configuration screen. This how it appears on the Business Rule Calculation Screen

Math - Sample.png

Things to Note

Did this answer your question?