Functions for lists and numerical values

Functions for lists and numerical values can be used in expressions.

For more information about lists and a video tutorial, see Working with lists.

The following functions can be used on lists and numbers, including dates and currencies.

Table 1. Functions for lists and numbers
Function Description Syntax
append Result is a list, where given items are appended at the end. Requires the list and the specified items to append.

append (listName, item1, item2, .... )

Examples:

append ([$Child:object type/field group:field name$], 5, 10, 15 )

append( [$listOperation$], 5, 10, 15 )

append( [$listOperation$], 'test1', 'test2', 'test3' )

min ( append ( [$objField1$] , 0.0 ) )

at Result is the field value of the item at the specified index position. Count -1 returns the last item in the list.

at (listName, indexPosition)

Examples:

at ([$Child:object type/field group:field name$], 5)

at ( [$objField1$], count ( [$objField1$] ) -1 )

avg Result is a numerical average. Requires one argument, which is an object field or list. Valid for numbers, currencies, and dates.

avg (listName)

Examples:

avg ([$Child:object type/field group:field name$])

avg(5, 10, 15, 20)

avg(list (5, 10, 15, 20)), builds the list and calculates the average

count Result is the number of objects or items that are counted. Requires one argument, which is an object field or list. Can optionally use Append and Remove with count.

count (listName)

Example:

count ([$Child:object type/field group:field name$]) result is the number of child objects

list Result is a list of items. Multiple arguments allowed.

list (listName, item1, item2, .... )

Example:

list ('test1','test2','test3')
max Result is the maximum value in a list of values. Valid for numbers, currencies, and dates.

max (listName)

Example:

max ([$Child:object type/field group:field name$])
min Result is the minimum value in a list of values. Valid for numbers, currencies, and dates.

min (listName)

Examples:

min ([$Child:object type/field group:field name$])

min(5, 10, 15, 20 )

min(list(5, 10, 15, 20))

remove Result is a list, where specified items have been removed. Provide the list and the specified items to remove. If items occur multiple times in a list, all occurrences are removed.

remove (listName, item1, item2, .... )

Example: remove(list('userA', 'userB', 'userC'), 'userB')

round The result is a rounded number.

The first argument is a number. The second argument is the number of decimal places the first number is rounded to. You can specify a maximum of 8 decimal places.

If you include only a single argument, the result is rounded to a whole number.

If the first argument is a list of values, the result is a list of rounded values.

round (number ,number of decimal places)

round (number)

Example:

round ([$variableA$], 3)
round Result is to round a value. Valid for numbers.

If the argument is a list of values, the result is a list of rounded values.

round (number)

Example:

round ([$Child:object type/field group:field name$])
sqrt Result is the value of the square root of a single number. Valid for numbers.

If the argument is a list of values, the result is a list of square root values.

sqrt (number)

Example:

sqrt ([$Child:object type/field group:field name$])
square Result is the square value of a single number. Valid for numbers.

If the argument is a list of values, the result is a list of squared values.

square (number)

Example:

square ([$Child:object type/field group:field name$])
sum Result is a sum of a collection of values. Valid for numbers and currencies.

sum (listName)

Example:

sum ([$Child:object type/field group:field name$])
Tip: When you use an expression that adds a list of decimal values, such as an expression that uses the sum function, using the round function on the values being summed helps to avoid an inaccurate decimal value in the result. For example, instead of using the expression sum( if(exists([$inval$])) then [$inval$] else 0 endif ), use the following expression, replacing <number_of_decimal_places> with the number of decimal places you want in the result.
sum( if(exists([$inval$])) then round([$inval$],<number_of_decimal_places>) else 0 endif )
Table 2. Examples of expressions that use functions for lists
Expression Result Note
count([$Child:SOXBusEntity/OPSS-BusEnt:Entity Type$]) 4 Given that there are 4 child objects
at ([$Child:SOXBusEntity/System Fields:Description$],5) Organizational Unit Given that "Organizational Unit" is the description of the object in the 6th position.
min(5, 10, 15, 20 ) 5  
list('test1', 'test2', 'test3') 'test1', 'test2', 'test3' Builds a list of items.
count( list ( 'test1', 'test2' ) ) 2 Builds a list and counts the items in it.

count (append( [$Child:object type/field$] , 'test3' ))

Result is the number of child objects plus 1 Adds to a count.