NUMERICARRAY

A set of methods, determined by the OPERATION type, that performs math operations on arrays of numeric values. Data types can be numeric, string, date, or integer. 

NUMERICARRAY: Elements and Attributes

 
TYPE=NUMERICARRAY
Element Attributes Parent Element Description Element/Attribute Value

<MathVariable>

TYPE     NUMERICARRAY
OPERATION  

Results in new array equal to array indicated by SOURCEARRAY attribute with element value appended.

Note:  If the SOURCEARRAY attribute is specified, the name must be the same as the name of the specified VARIABLENAME.

A variable or decimal literal whose value is appended to SOURCEARRAY.
APPEND
  Takes a SOURCEARRAY attribute and creates a separate but identical array. COPY
 

A new array with the length equal to the element value and each value defaulting to the value of DEFAULT attribute.

A literal value or math variable whose value is the length of the new array.
CREATE

 

Creates an array by duplicating each element of the original array a given number of times. As a comma delimited list of three multiplier values:

The first multiplier indicates the number of times that the first element of the array is repeated.

The middle multiplier indicates the number of times that all elements other than the first and last elements are repeated.

The last multiplier indicates the number of times that the last element of the array is repeated.

Use the MULTIPLIER attribute to indicate the number of times each element of the original array should be duplicated. The first and last elements may have a different number of duplicates than the other elements, so this attribute's value can be a comma delimited list of, at most, three values. If only one value is supplied, the others are defaulted to that value.
EXPAND

 

Creates an array of the resulting data returned by a SQL statement. The SQL statement must return one column with any number of rows.

A valid SQL statement that returns one or more decimal values.
FILLBY-SQL

  Fills the array with the values entered.

Comma separated list of decimal constants and/or variable names.

FILLBY-LIST

 

Fills the math variable with an array of decimal values returned from the named stored procedure. This attribute requires PROCEDURENAME and a list of parameters where applicable.

FILLBY-STOREDPROCEDURE

  Results in the new array equal to the array indicated by SOURCEARRAY attribute with an element value inserted/placed into the array at the index indicated by the INDEX attribute.

A variable or decimal literal whose value is to be inserted into the array at INDEX.
INSERT

  Results in an array identical to SOURCEARRAY with the element at INDEX removed. REMOVE
 

Replaces a value at the specified array position with the element’s value. The INDEX attribute will either have an index value or two index values separated by a comma. If INDEX contains only one value, the element at that index is replaced by the value provided by the math variable. If INDEX contains two values, the elements from the first index to and including the second index are replaced by the value provided by the math variable.

Note: If the SOURCEARRAY attribute is specified, the name must be the same as the name of the specified VARIABLENAME.

A math variable or decimal literal to replace one or more of the elements of the current array.


REPLACE

  Results in the new array where each element is the larger of the corresponding element from SOURCEARRAY and the string element value.

A variable or decimal literal.
SETMAX

  Results in the new array where each element is the smaller of the corresponding element from SOURCEARRAY and the string element value.

A variable or decimal literal.
SETMIN

  Results in the new array containing every 'nth' element in the SOURCEARRAY where n is the element value.

A variable or integer literal.
STRIDE

 

Performs the indicated calculation to every element of the referenced array(s) and stores each result in the math variable which is also an array. When multiple arrays are used, they must have the same length.

Any valid expression. If the array elements are to be updated by using their current value in the calculation, use the name of the array in place of that value. If the value is just the name of another array variable, then that array is copied.
TRANSFORM

<Parameters>

   

Opening element that allows multiple parameters to be defined.

 

<Parameter>

   

Defines the values to be passed as input to the stored procedure.

Variable name defined in a prior math statement, literal value or expression that results in an appropriate data type.

NAME

 

Defines the name of the parameter exactly as defined in the stored procedure.

A literal value.

DATATYPE     A literal value. Values are limited to:

BIGTEXT

DATE

TEXT

INTEGER

DECIMAL

<MathVariable>

CLEARVALUE

 

Optional Element:

Yes: The value of the math variable will be deleted after the execution of all the Attached Rules at the end of activity processing and will not be visible on the Math tab in the Activity details screen.

No: The value of the math variable will be retained after activity processing and will be displayed in the Math tab in the Activity details screen.

Value: Yes / No

Default Value: No

XML Schema

When OPERATION="APPEND"

<MathVariables>
<MathVariable VARIABLENAME="[name]" TYPE="NUMERICARRAY" OPERATION="APPEND" 
SOURCEARRAY="[math variable]" DATATYPE="DECIMAL">[math variable | literal]
</MathVariable>
</MathVariables

When OPERATION="ARRAYFUNCTION"

<MathVariable VARIABLENAME="[name]" TYPE="NUMERICARRAY" OPERATION="ARRAYFUNCTION" 
SOURCEARRAY="[array]" DATATYPE="DECIMAL">[math variable | literal]</MathVariable>

When OPERATION="COPY"

<MathVariable VARIABLENAME="[name]" TYPE="NUMERICARRAY" OPERATION="COPY"

SOURCEARRAY="[math variable]" DATATYPE="DECIMAL"/>

When OPERATION="EXPAND" - option 1-a

<MathVariable VARIABLENAME="[String]" TYPE="NUMERICARRAY"
OPERATION="EXPAND" SOURCEARRAY="[String]" DATATYPE="DECIMAL">[String]</MathVariable>

When OPERATION="EXPAND" - option 1-b

<MathVariable VARIABLENAME="[String]" TYPE="NUMERICARRAY" OPERATION="EXPAND" 
SOURCEARRAY="[String]" DATATYPE="DECIMAL">[String],[String],[String]</MathVariable>

When OPERATION="EXPAND" - option 2-a

<MathVariable VARIABLENAME="[String]" TYPE="NUMERICARRAY"
OPERATION="EXPAND" MULTIPLIER="[String]" DATATYPE="DECIMAL">[String]</MathVariable>

When OPERATION="EXPAND" - option 2-b

<MathVariable VARIABLENAME="[String]" TYPE="NUMERICARRAY"
OPERATION="EXPAND" MULTIPLIER="[String],[String],[String]" DATATYPE="DECIMAL">[String]</MathVariable>

When OPERATION="FILLBYLIST"

<MathVariable VARIABLENAME="[name]" TYPE="NUMERICARRAY" OPERATION="FILLBY-LIST" 
DATATYPE="DECIMAL">[math variable list | literal list]</MathVariable>

When OPERATION="FILLBYSQL"

<MathVariable VARIABLENAME="[name]" TYPE="NUMERICARRAY" OPERATION="FILLBY-SQL" 
DATATYPE="DECIMAL">[sql]</MathVariable>

When OPERATION-"FILLBYSTOREDPROCEDURE"

<MathVariable VARIABLENAME="[name]" TYPE="NUMERICARRAY" OPERATION="FILLBY-STOREDPROCEDURE" 
PROCEDURENAME="[name]" DATATYPE="DECIMAL">
<MathVariable VARIABLENAME="[name]" TYPE="NUMERICARRAY" OPERATION="[INSERT | REMOVE]" SOURCEARRAY="[math variable]" INDEX="[math variable | literal]" DATATYPE="DECIMAL">[math variable | literal]</MathVariable>

When OPERATION="INSERT"

<MathVariable VARIABLENAME="[String]" TYPE="NUMERICARRAY" OPERATION="INSERT" 
INDEX="[String]" SOURCEARRAY="[String]" DATATYPE="DECIMAL">[String]</MathVariable>

When OPERATION="REMOVE"

<MathVariable VARIABLENAME="[String]" TYPE="NUMERICARRAY"
OPERATION="REMOVE" INDEX="[String]" SOURCEARRAY="[String]" DATATYPE="DECIMAL"></MathVariable>

When OPERATION="REPLACE"

<MathVariable VARIABLENAME="[name]" TYPE="NUMERICARRAY" OPERATION="REPLACE" 
SOURCEARRAY="[math variable]" INDEX="[math variable | literal | literal list | math variable list]" 
DATATYPE="DECIMAL">[math variable | literal]</MathVariable>

When OPERATION="SETMIN" or OPERATION="SETMINALL" or OPERATION="SETMAX" or OPERATION="SETMAXALL"

<MathVariable VARIABLENAME="[name]" TYPE="NUMERICARRAY" OPERATION="[SETMAX | SETMIN | STRIDE]" 
SOURCEARRAY="[math variable]" DATATYPE="DECIMAL">[math variable | literal]</MathVariable>

When OPERATION="TRANSFORM"

<MathVariable VARIABLENAME="[name]" TYPE="NUMERICARRAY" OPERATION="TRANSFORM" 
DATATYPE="DECIMAL">[expression | array]</MathVariable>

When OPERATION ="CREATE"

<MathVariable VARIABLENAME="[name]" TYPE="NUMERICARRAY" OPERATION="CREATE" 
DEFAULT="[literal]" DATATYPE="DECIMAL">[math variable | literal]</MathVariable>

XML Examples

Create and Append

<MathVariable VARIABLENAME="PaymentArray" TYPE="NUMERICARRAY" OPERATION="CREATE" DATATYPE="DECIMAL">0</MathVariable>
<MathVariable VARIABLENAME="PaymentArray" TYPE="NUMERICARRAY" OPERATION="APPEND" SOURCEARRAY="PaymentArray" DATATYPE="DECIMAL">Payment</MathVariable>

Create and FILLBY-SQL

<MathVariable VARIABLENAME="PaymentArray" TYPE="NUMERICARRAY" OPERATION="CREATE" DATATYPE="DECIMAL"></MathVariable>
<MathVariable VARIABLENAME="PaymentArray" TYPE="NUMERICARRAY" OPERATION="FILLBY-SQL" DATATYPE="INTEGER">SELECT INTEGERCRITERIA FROM RATETABLE WHERE RATEDESCRIPTION = '[RateDescription]' </MathVariable>

Create and FILLBY-LIST

<MathVariable VARIABLENAME="LapseAccountingArray" TYPE="NUMERICARRAY" OPERATION="CREATE" DATATYPE="DECIMAL">0</MathVariable>
<MathVariable VARIABLENAME="LapseAccountingArray" TYPE="NUMERICARRAY" OPERATION="FILLBY-LIST" DATATYPE="DECIMAL">RemainingIssueCharge,SurrCharge,LapseAccountingCOI</MathVariable>

Create and FILLBY-STOREDPROCEDURE

<MathVariable VARIABLENAME="Rates" TYPE="NUMERICARRAY" OPERATION="CREATE" DATATYPE="DECIMAL"></MathVariable>
<MathVariable VARIABLENAME="Rates" TYPE="NUMERICARRAY" OPERATION="FILLBY-STOREDPROCEDURE" DATATYPE="DECIMAL" PROCEDURENAME=" TestRatesProc ">
<Parameters>
<Parameter NAME="AGE" DATATYPE="INTEGER">VarAge</Parameter>
<Parameter NAME="GENDER" DATATYPE="TEXT">01</Parameter>
</Parameters>
</MathVariable>