Configure calculation sets
In Q2 Origination, you can use calculation sets to configure the computation formulas, and the records to be fetched at the run time for the computations. The order of configuration and execution are opposite to each other. You need to define dynamic query first, then expression assignments, and then calculation set.
When a calculation set is evaluated, then all the linked expression assignment records are fetched, parsed to get associated dynamic query records. Then the code fetches the records based on the dynamic queries, and expression assignments are evaluated based on these values.
Defining Dynamic Queries: To know how to define dynamic queries, refer to Dynamic queries.
Defining Expression Assignments: In Q2 Origination, expression assignments determine, the computation formula for a calculation set, and the objects where the computed result is to be stored.
Prerequisites
Dynamic queries that are to be used must be defined.
Steps
To define an expression assignment, do the following:
Log in to your Salesforce account.
On the Expression Assignments tab, select New.
Specify the following details as described.
Object Name: the object where the computation results are to be stored.
Field Name: the field of the object defined above, where the computation results are to be stored.
Evaluation Expression: the objects from where the records have to be fetched for computation. It also contains the computation formula.
Example of Expression Assignment
The following image displays an example of an expression assignment. The computation formula, defined under Evaluation Expression, is used to compute results. The objects, from where the records are to be fetched, are defined in the dynamic query linked with the expression assignment.
ApplicationLiabilityQuery.Debt: the ApplicationLiabilityQuery query fetches the value of the Debt field.
ApplicationMonthlyIncomeQuery.MonthlyIncome: the ApplicationMonthlyIncomeQuery query fetches the value of the MonthlyIncome field.
ApplicationEmploymentInfoQuery.EmploymentInformation: the ApplicationEmploymentInfoQuery fetches the value of the EmploymentInformationfield.
ApplicationAnnualIncomeQuery.Income: the ApplicationAnnualIncomeQueryquery fetches the value of the Income field.
The computation result is stored in the genesis__Unsecured_Debt_To_Income_Ratio__c field of the genesis__Applications__c object.
Define Calculation Sets: On Q2 Origination, calculation sets consist of the following:
Calculation Expressions: A calculation expression is a link between a calculation set and an expression assignment.
Note:A calculation set can have one or more expression assignments linked to it, and an expression assignment can be a part of one or more calculation sets. So, a calculation expression helps define a 1:1 relationship between the two.
Expression Assignments: an expression assignment is used to define, the computation formula, and the records where the computation results are to be stored.
Prerequisite
Expression assignments to be used must be defined.
To know more about expression assignments, refer to Defining expression assignments.
Steps
To define a calculation set, do the following:
Log in to your Salesforce account.
On the Calculation Set tab, select New.
Name the calculation set, and select Save.
The defined calculation set is listed under the Calculation Set tab, in the Calculations section with the following details.
Calculation Name: the identifier of the link record between the calculation set, and the expression assignment used.
Expression Assignment: defines the computation formula, and the object where the computed result is to be stored.
Object Name: the object where the computed result is to be stored.
Field Name: the field of the object where the computed result is to be stored.
Evaluation Expression: defines the computation formula, and the dynamic query used by the expression assignment.
Example of a Calculation Set
The following image displays an example of a Calculation Set with the name Debt to Income Computation. This set consists of 6 Calculation Expressions. Each Calculation Expression has an Evaluation Expression or a formula defined in it. The Calculation ExpressionCALC-0344 of this Calculation Set uses the Expression AssignmentEXP-ASGMT-02009.
To understand the Expression Assignment EXP-ASGMT-02009, refer to Understanding expression assignment.