|
If an attribute affecting a calculated attribute is modified when creating or editing an object, the formula is not immediately reevaluated. Once the create action or edit action is processed, the formula is reevaluated and the calculated attribute value is updated.
For information on how calculated attributes are displayed when included in attribute layouts, see Attribute Display.
|
|
There are no multi-valued functions currently supported for calculated attributes.
|
Function
|
Description
|
isNull( )
|
Null check
|
unit( )
|
Convert String data type to Real Number with Units data type
|
str( )
|
Convert number to String data type
|
abs( )
|
Absolute value or magnitude
|
avg( )
|
Average of a list of values
|
sum( )
|
Sum of a list of values
|
min( )
|
Minimum of a list of values
|
max( )
|
Maximum of a list of values
|
round()
|
Converts a number with a decimal (real number) into an integer number
• When the decimal contains .5, the number is rounded to an even number (for example, 30.5 is rounded down to 30 and 31.5 is rounded up to 32)
• When the decimal contains other numbers, the number is rounded to the nearest number (for example, 30.8 is rounded up to 31 and 33.4 is rounded down to 33)
|
mod()
|
Returns the remainder of one number divided by another number. (Integer data types, only)
|
${}
|
Wraps attribute internal names which include special characters, so they can be used within the formula. All attribute internal names can be wrapped, but attribute internal names which include the dash (-), dollar sign ($), or square brackets ([ ]) must be wrapped when used in formulas. For example, attributes with internal names of my-attribute or my[very$complex]-attribute can be used in a formula when wrapped as follows:
• ${my-attribute}
• ${my[very$complex]-attribute}
If the attributes used in the Example: Calculating a Numerical Value section had internal names which include special characters, the formula for the Total Cost attribute could appear as follows:(${item-quantity}*${unit-cost})+${handling-fee}
|
Operator
|
Description
|
+
|
Addition; can also be used to concatenate strings
|
-
|
Subtraction
|
*
|
Multiplication
|
/
|
Division
|
( )
|
Open and closed parentheses, to indicate a different priority in the order of operations (the operations within the parenthesis are to be performed first)
|
" "
|
Double quotes, to indicate that the content of the quotes is a literal string. Any non-number not inside double quotes is treated as an attribute name
|
>
|
Greater than
|
<
|
Less than
|
>=
|
Greater than or equal to
|
<=
|
Less than or equal to
|
==
|
Equal to
|
!=
|
Not equal
|
^
|
Power or exponentiation
|
&
|
And
|
|
|
Or
|
~
|
Not
|
^*
|
Exclusive or
|
&&
|
And
|
||
|
Or
|
!
|
Not
|
? :
|
Conditional operator, indicating the result if the specified condition is true or false:
(condition) ? value if true : value if false
For example, assume that a type has attributes of length, width, and shape, where shape is a calculated attribute with the following formula:
(length>width) ? "longer" : "wider"
If the value of the length attribute is greater than the value of the width attribute, then the shape attribute is assigned a value of longer. If the value of the length attribute is not greater than the value of the width attribute, then the shape attribute is assigned a value of wider.
|
%
|
Remainder
|