Versions Compared

Key

  • This line was added.
  • 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
minMinimum

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)

maxMaximum

Returns the largest value among its arguments.

Examples:

max(3,1) results in 3

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

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

sumSumReturns the sum of its arguments.
prodProductReturns the product of its arguments.
avgAverageReturns the arithmetic average value of its arguments: the sum of the values divided by the number of values.
geomanGeometric 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).
sqrtSquare rootReturns the square root of its (single) arguments.
absAbsolute 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
showLabelsfalse
max6
showSpacefalse
titleRelated articles
cqllabel = "calculated-field" AND label not in ("troubleshooting","archive") and space = "knowledge"



Panel
borderColor#D9E2EC
bgColor#F7FAFC
borderWidth1
titleIntroductory eLearning course

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

UI Button
colorblue
newWindowtrue
tooltipView course
titleView course
urlhttps://www.bizzdesign-academy.com/course/view.php?id=1357