You are here: Transaction Rules > Transaction Elements > Math Element > AGGREGATEFUNCTION

AGGREGATEFUNCTION

Description

AGGREGATEFUNCTION is used to perform functions on arrays.  Functions include counting elements, summing elements and retrieving specific element data from the array.

AGGREGATEFUNCTION Element/Attribute Table

Element

Attribute

Attribute Value

Result

<MathVariable>

TYPE

AGGREGATEFUNCTION

The name of a previously defined array.

 

METHOD

COUNT

Returns the number of elements in the array.

 

 

EXISTS

Returns 1 if the specified value exists in the array, or 0 if it does not.

   

INDEX

Allows the configuror to retrieve specific data from position provided by an additional attribute, INDEX. Whatever the means to provide INDEX with a value, it must be a positive integer less than the number of elements in the array. If not, an exception will occur.

 

 

INDEXOF

The index within the array of the first occurrence of the required value LOOKUP.If LOOKUP does not occur within the array, return the value RETURNVALUE or'-1',if RETURNVALUE is not specified.

   

SUM

Returns the sum of all the elements in the array. The elements of the array must be one of the numeric data types.

 

 

SUMSCALE

The sum of all numbers in the given array multiplied by the value of the SCALE attribute

    MAXOF Returns the highest element value in the array.
    MINOF Returns the lowest element value in the array.

 

 

TOSTRING

The array in string form

  ARRAYNAME   Name of the MathVariable assigned to the array you are manipulating using one of the aggregate function methods.

XML Example

<MathVariable VARIABLENAME="SegmentCount" TYPE="AGGREGATEFUNCTION" METHOD="COUNT" DATATYPE="INTEGER">Segments</MathVariable>

<MathVariable VARIABLENAME="FunctionMax" TYPE="AGGREGATEFUNCTION" METHOD="MINOF" DATATYPE="INTEGER">ArrayName</MathVariable>

<MathVariable VARIABLENAME="FunctionMin" TYPE="AGGREGATEFUNCTION" METHOD="MAXOF" DATATYPE="INTEGER">ArrayName</MathVariable>

<MathVariable VARIABLENAME="LastPremiumYear" TYPE="AGGREGATEFUNCTION" METHOD="INDEX" INDEX="PremiumIterations-1" DATATYPE="INTEGER">PremiumYearArray</MathVariable>

 



Copyright © 2009, 2011, Oracle and/or its affiliates. All rights reserved. Legal Notices