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.
TYPE=CURRENCY | |||
---|---|---|---|
Element | Attributes | Attribute Value | Definition |
<MathVariable> |
|||
VARIABLENAME | Literal string |
Required |
|
TYPE | "CURRENCY" |
Required:Identifies type of the MathVariable. |
|
OPERATION | "CONVERT" |
Required:Describes the operation performed by the MathVariable. |
|
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 | Currency code. Literal string or another MathVariable: e.g. “USD” string, or “Plan:DefaultCurrencyCode” MathVariable. |
Required:Target currency code. |
|
EXCHANGEDATE | Field or MathVariable containing a date value. |
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. |
|
MARKETMAKER | MarketMakerGUID, (obtained from AsMarketMaker table) may be defined through another MathVariable or Field: e.g. “PlanMarketMakerGUID” |
Required:Unique identifier for the Market Maker (i.e. MarketMakerGUID). Together with Exchange Rate, Market Maker database tables designate Currency conversion protocols. |
|
DATATYPE | "CURRENCY" |
Required |
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>