IMPORTANTAfter the October 2018 release, Admins cannot create new Custom Rules. Gainsight recommends creating Bionic Rules as they are more powerful than Custom Rules, and they help Admins reduce the number of overall rules that you need to configure and manage. For assistance with Bionic Rules, check out the following resources:
This tutorial demonstrates you on how you can use Custom Rules to perform Aggregations. There are two methods to aggregate data in Custom Rules. Both the methods are explained in this tutorial.
- This tutorial is presented for educational purposes only.
- Always test your rules before running them in a production environment.
- Understand your Salesforce environment before performing any operations which may affect your data.
In a Custom Rule, you can perform aggregation by two methods.
- Aggregating using the Show section
- Aggregating using the Add Calculated Field
Aggregation using the Show section
In this method Aggregation is performed on a field when it is added in the Show section. In this method, you cannot modify the time period for aggregation.
- Navigate to Administration > Rules Engine.
- Click Create Rule.
- Select Custom as the Rule Type.
- Create the Rule For an Account.
- Enter a name in the Rule Name field.
- (Optional) Add a description, in the Description field.
- Click Next.
Setup Rule Show Section
- Select Native Data as the source.
- Select Usage Data as the source Object.
- Add the following fields to the Show section:
Aggregation using Calculated Fields
In this section, the aggregation is performed using the Add Calculated Field option. In this method of aggregation, you can choose specific time period for which the aggregation must be done. In this example Average is aggregated for the past 90 days.
- Click Add Calculated Field.
- In the Add Calculated Field window:
- Enter a name in the Field name field.
- Select Aggregation (over time) as the Type of calculation.
- Select AVG as the aggregation type.
- Select User Activity as the metric.
- Enter 90 and select Days.
- Select the Adjust for missing data check box. This ensures that if data is missing for any given date, the average calculation is adjusted to consider only the available data.
- Click OK.