# Page History

## Key

• This line was removed.
• Formatting was changed.

Calculated fields in data blocks use expressions that specify the operations and functions to be performed, the referenced attribute fields, and any needed value conversion. The tables below show the operations and functions that can be used in expressions of calculated fields.

Info

For defining calculated fields it is assumed that you have some familiarity with scripting.

# Operations

The following operations can be used in the expression of a calculation field:

NotationOperationExplanation
`+`Add

Adds the operands. If both operands are integer, the result is also integer. Otherwise the result will be real.

Example: `2+3` results in `5`

`-`Subtract

Subtracts the right operand from the left. If both operands are integer, the result is also integer. Otherwise the result will be real.

Example: `2-1` results in `1`

`*`Multiply

Multiplies the operands. If both operands are integer, the result is also integer. Otherwise the result will be real.

Example: `2*3` results in `6`

`/`Divide

Divides the left operand by the right. If both operands are integer, the operation will perform integer division and the result is also integer. In all other cases, the operation will be a proper division and the result will be real.

Examples:

`4/3` results in `1`

`4.0/3` results in `1.33`

# Functions

The following predefined functions can be used in the expression of a calculated field:

NotationFunctionExplanation
`min`Minimum

Returns the smallest value among its arguments.

Examples:

`min(3,1)` results in `1`

`min(2/5,1)*10+4` results in `4 `

(intermediate calculations: = `min(0,1)*10+4` = `0*10+4` = `0+4` = `4`)

`max`Maximum

Returns the largest value among its arguments.

Examples:

`max(3,1)` results in `3`

`max(10/5,1)*10+4` results in `4` `24`

(intermediate calculations: = `max(2,1)*10+4` = `2*10+4` = `20+4` = `24`)

`sum`SumReturns the sum of its arguments.
`prod`ProductReturns the product of its arguments.
`avg`AverageReturns the arithmetic average value of its arguments: the sum of the values divided by the number of values.
`geoman`Geometric meanReturns the geometric mean value of its arguments: the N-th root of the product of the values (with N equal to the number of values).
`sqrt`Square rootReturns the square root of its (single) arguments.
`abs`Absolute valueReturns its (single) argument unchanged if it.

# Parentheses and brackets

NotationOperationExplanation
`( )`Parentheses

Can be used for specifying the order of operations.

Example: `2*(3+4)` results in `14`

< >Angle brackets

Can be used for referencing other attribute fields.

Example: `2.0*<licensecosts> + 3.0*<maintenancecosts>`

Content by Label
showLabels false 6 false Related articles label = "calculated-field" AND label not in ("troubleshooting","archive") and space = "knowledge"

Panel
borderColor #D9E2EC #F7FAFC 1 Introductory eLearning course

Check out the free Enterprise Studio introductory eLearning course to learn about data blocks.

UI Button
color blue true View course View course https://www.bizzdesign-academy.com/course/view.php?id=1357