Calculated attribute types
A Calculated attribute is a read-only field whose value is calculated based on a specified formula.
When you save a form that contains calculated attributes, IBM® Marketing Operations checks the formulas to ensure that they are valid.
A Calculated attribute has the following additional basic options.
Formula syntax
You can perform the following binary operations.
*
*
*
*
You can perform the following operations on an arbitrary number of comma-separated operands.
*
Sum: for example, Sum(Salary, 1000, Bonus)
*
Avg: arithmetic average, for example, Avg(BudgQtr1, BudgQtr2, BudgQtr3)
*
Min: select the minimum value, for example Min(IQ, 125)
*
Max: select the maximum value, for example Max(Sale1, Sale2, Sale3, Sale4)
An operand can be any of the following.
*
*
Calculated attribute example
Assume the Wages form contains the following currency fields: BaseSalary, Bonus, Insurance, and FedTax. You could create a calculated field named Net pay, and enter the following formula for it: BaseSalary+Bonus-FedTax-Insurance
Example to avoid
Since you can reference one calculated field within another, take care to avoid infinite recursion. For example, consider a form with the following attributes.
*
Salary: an integer or money attribute
*
Commission = Salary + (Bonus * 0.10)
*
Bonus = (Commission * 0.5) + 1000
The Commission and Bonus attributes refer to each other, creating an infinite loop when the system attempts to calculate the values.
Grid attribute example
Calculated fields can be used in grids and on forms. A simple example is if a grid contains columns for units and cost per unit, you can create a column for the grid to represent the total cost: Units * CostPerUnit