Overview
This rating method allows you to define a custom formula that will be used for rating. The formula is applied against the rate this in turn to the usage that is fed through the system. Using this rating method is a little involved as you need to be familiar with the functions that can be used when creating the formulas.
The list of available operators can be found in the Formula Operators and Functions section. Operands that are available for use are:
 Fields in the following BillingPlatform entities:
 ACTIVITY  Invoice line item that the formula product is using. Common fields include Cost, Qty, RateOverride.
 COLLECTOR  Entity that houses the usage data that is sent to the product during rating. This is used if you need to manipulate the way that routing is done.
Operands are entered using the platform formula language. This allows you to use operators, functions, and the object reference model to source fields that are accessible from the ACTIVITY entity.
Procedure
Step 1. Create a new product.
Go through the motion of creating a new product by referring to the How To Create A New Product section. When asked to specify the Rating Method, select Formula.
At this point, you can specify the formula that will be used by the product whenever it is invoked by using the platform formula language. Here you can specify formulas for the Quantity or the Cost/Value. Aside from providing flexibility to the quantity data, this allows for more complex quantity value determination to happen and this is fed into other features in the rating engine that involves quantity values such as tiered pricing determination.
At least one formula field needs to be populated. If the Formula Quantity is left blank, it will be represented as 1. If the Formula Cost is left blank, the cost will be computed using the standard Quantity * Rate formula.
Note that the Formula Quantity value does not feed into the Formula Cost when both are populated. Only when the Formula Cost is blank will the computation default to Quantity * Rate.
Step 2. Specify the rate details
You have the ability to skip defining the default rate for the product for later definition when provisioning to a customer or when it is added to a package as a package product. For the purpose of this process, we will define the default rate for the product that you created.
Click the Specify Default Rate checkbox and enter the rate corresponding to the currency code that the product will be used for.
Refer to table 1 below for the field definitions to help you populate the rate details and other sections of the formula product wizard.
Click Submit to save the changes.
Terms Defined
Field Name  Description 
Formula Quantity 
Indicates the quantity that will be used during rating. If left blank, this is defaulted to 1. If a formula is provided, it will obtain the value by evaluating the formula. The platform formula language can be used here. 
Formula Value 
This is where the formula is defined. The platform formula language can be used in this section. Note that the formula specified here will influence the Cost of the formula product when it is added to the invoice. For example, the following formula takes 10% of all of the invoice line item Cost values and then multiple it by the Rate of the formula product. (sum({!ActivityObj.Cost})*0.10) * {!ActivityObj.Rate} The syntax can be checked by clicking the Check Syntax button. If the there are syntax errors in the formula used, if will be shown as an error. The error needs to be addressed in order for the formula product to be saved. 
Propagate To Hierarchy 
When checked, the formula product will be invoked whenever an invoice is closed for ALL accounts in the org. This will remove the dependency to the product being provisioned to the account. 
On Invoice Close 
When checked, the formula product is added to the invoice and will be evaluated. If Propagate To Hierarchy is not ticked for the product, it needs to be provisioned to an account as an Account Package Product or an Account Product. 
Split Charges by SubAccount 
Applicable when On Invoice Close is ticked. Check this flag if the formula charge will be created for each element/group under the hierarchy. When checked and there are charges on the invoice that were routed from child accounts, charges will be created for each child account record.
For example: Invoice 12345 is generated under Account A. In this invoice, there are charges routed from Account B, which is a child to Account A. If the formula on invoice close charge is triggered based on its filter and group by rules, it will generate separate charges for each routed child account charge(s) from Account B.

Formula Group Identifier 
Applicable when On Invoice Close is ticked. This table allows for the inclusion on how the formula product will be added to the invoice. When no conditions are added, the product will be added once to the invoice. If conditions are added, it will be added for each unique occurrence of the values of the conditions. This allows you to add the formula product multiple times and evaluating the formula against different conditional values. For example, the formula product will be applicable to all unique instances of a product's name (like a tax product), etc. 
Formula Group Record Filter 
This grid allows you to specify rules when the formula product is triggered. If there are no rules specified, the formula will always be added when triggered on invoice close or through usage identifiers. 
Formula Group Filter Logic  This allows you to specify the logic of the formula filters defined in the previous table. Each rule corresponds to a row number in the order they appear on the grid so more complex logical statements can be used such as 1 OR 2 AND 3, or (1 AND 2) OR 3. 
Force Generate Activity  Applicable only when On Invoice Close is ticked, this allows the formula product to be added to an invoice even if the Formula Group Record Filter rules are not satisfied. This means that aggregation functions on the Formula Quantity and Formula Cost fields that use the {!ActivityObj.Rate} or {!ActivityObj.Cost} values will return NULL. This is particularly useful when the formula parameters that you need are located elsewhere in the data model and not necessarily on the Activity record. 
Tiered Rate Type 
Only applicable for Tiered Pricing, this allows for choosing the behavior of how usage data is handled for tiered rates. Available choices are:

Tier Calculation Level 
Only applicable for tiered pricing, this indicate the aggregate level of the tiered rates. Available options are:

Split Usage Crossing Bands  When dealing with large chunks of data, enabling this option will allow the splitting of usage data across bands. Disabling the option will have the large chunk rated against the lower band. 
Pricing Type 
Indicates the type of pricing that the product will use. Available options are:

Rate 
Pricing rate of the product. 
Min Charge 
Minimum charge when this product is charged to the customer. If the computed rate multiplied by the # of consumed units is less than the minimum charge, the minimum charge will be reflected on the customer's invoice. 
Related
Comments