CURRENCY

This type allows the conversion of a MathVariable CURRENCY data type to another specified currency where an exchange rate is to be applied. It also may be used to convert a decimal variable that represents a known currency, such as the Valuation:Policy:CashValue expression. Applying a currency code to a numeric value without applying an exchange rate is done with the ToCurrency() function.

CURRENCY: Elements and Attributes
TYPE=CURRENCY
Element Attributes Parent Element Description Element/Attribute Value

<MathVariable>

       
  VARIABLENAME  

Required

Literal string

TYPE  

Required:  

Identifies type of the MathVariable.

CURRENCY

OPERATION  

Required:

Describes the operation performed by the MathVariable.

CONVERT

FROMCURRENCY  

Currency code. Literal string or another MathVariable: e.g. “USD” string, or “Plan:DefaultCurrencyCode” MathVariable.

Currency code. Literal string or another MathVariable: e.g. “USD” string, or “Plan:DefaultCurrencyCode” MathVariable.

TOCURRENCY  

Required:

Target currency code.

Currency code. Literal string or another MathVariable: e.g. “USD” string, or “Plan:DefaultCurrencyCode” MathVariable.

EXCHANGEDATE  

Optional:

Date the system will use for the currency conversion calculation. If not specified, the system will use the last exchange rate as of the system date.

Field or MathVariable containing a date value.

MARKETMAKER  

Required:

Unique identifier for the Market Maker (i.e. MarketMakerGUID). Together with Exchange Rate, Market Maker database tables designate Currency conversion protocols.

MarketMakerGUID, (obtained from AsMarketMaker table) may be defined through another MathVariable or Field: e.g. “PlanMarketMakerGUID”

DATATYPE  

Required

CURRENCY

CLEARVALUE

 

 

Value: Yes / No

Default Value: No

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.

XML Example

<MathLoop TYPE="SEGMENT" VARIABLENAME="BaseLoop" POLICY="[Policy:PolicyGUID]">
<MathVariable VARIABLENAME="TypeCode" TYPE="SEGMENTFIELD" SOURCEARRAY="BaseLoop" DATATYPE="TEXT">TypeCode</MathVariable>
<MathIF IF="TypeCode = '04'">
<MathVariable VARIABLENAME="SegmentGUID" TYPE="SEGMENTFIELD" SOURCEARRAY="BaseLoop" DATATYPE="TEXT">SegmentGUID</MathVariable>
<MathVariable VARIABLENAME="SumAssured" TYPE="SEGMENTFIELD" SOURCEARRAY="BaseLoop" DATATYPE="CURRENCY">SegmentAmount</MathVariable>
<MathVariable VARIABLENAME="SumAssuredCurrency" TYPE="FUNCTION" DATATYPE="TEXT">GetCurrencyCode(SumAssured)</MathVariable>
<MathVariable VARIABLENAME="Tobacco" TYPE="SEGMENTFIELD" SOURCEARRAY="BaseLoop" DATATYPE="TEXT">SegmentTobaccoPremBasis</MathVariable>
</MathIF>
</MathLoop>
<MathVariable VARIABLENAME="PolicyCashValue" TYPE="EXPRESSION" DATATYPE="DECIMAL">Valuation:Policy:CashValue</MathVariable>
<MathVariable VARIABLENAME="PolicyCashValueInSumAssuredCurrency" TYPE="CURRENCY" MARKETMAKER="Plan:MarketMakerGUID" 
FROMCURRENCY="Plan:DefaultCurrencyCode" TOCURRENCY="SumAssuredCurrency" OPERATION="CONVERT" EXCHANGEDATE="Activity:EffectiveDate" 
DATATYPE="CURRENCY">PolicyCashValue</MathVariable>
<MathVariable VARIABLENAME="DeathBenefit" TYPE="EXPRESSION" DATATYPE="CURRENCY">SumAssuredInBaseCurrency - PolicyCashValue</MathVariable>