Tutorial Overview

Subject: This tutorial demonstrates a detailed example for using a Calculated Field within the Rules Engine
Scenario: A common ask of the Admin involves monitoring and taking action upon usage patterns such as growth or decline in usage.   This use case uses a Calculated Field to determine a decline in usage by referencing a running average, then creates a Call to Action (CTA) with information for a CSM to use to follow-up with a customer.
Complexity: Easy/Medium
Description: Replace NULL or missing values with zero values.
Challenges: Know your data. Gaps/NULLS can create false positives.
  1. Create a rule to inspect usage data, looking for a trigger point of 25% by using a Calculated Field
  2. The calculated field will determine the running average of Logins over a 1-week period
  3. Create a CTA with a Playbook for a CSM to contact the customer

Notes and Tips


  • 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.
  • IMPORTANT: Know your data to ensure that Usage Data is clean and accurate to avoid triggering CTAs against false-positives (or conversely, missing true positives).

Step 1 - Create New Rule

In this step, create a new rule using a Calculated Field for comparison.

Step 1a - Create New Rule

Create a New Rule with the following parameters:

  • Rule Type: Custom
  • Rule Name:  Logins dropped by 25% in the Past Quarter
  • Description: Detect accounts for which logins, compared to a weekly running average, has dropped by 25% or more.
  • Show:  Account::Id, Account::CSM, Account::Account Name
  • Filters:  
    • Usage Data::Logins / not equal to / Check (NULL)

NOTE:  Checking NULL eliminates some false positives.

Click "Add Calculated Field" to proceed to the next step.

Step 1b - Create a Calculated Field

  • Field Name: Logins over Past 3 Months

  • Select "Comparison"

  • Select "Percentage
  • Under A:

    • Select "Aggregation (over time)"
    • SUM / Logins
    • Past / 1 /  Weeks
  • Under B:

    • Select "Aggregation (over time)
    • AVG / Logins

    • Past / 3 / Months
  • Click "Ok" to save and return to the Rule
  • Click "Next" to proceed to the Action screen

Step 1c - Create the Action

Create a new action:

  1. Action Type: Call to Action
  2. Create/Close:  Create CTA
  3. Name: Logins for ${Account::Account Name} dropped by 25% in the past Quarter  (Type @ to use tokens)
  4. Priority: Medium
  5. Status: New
  6. Reason: Adoption Issues
  7. Type: Risk
  8. Owner Field: Account::CSM
  9. Default Owner: <Your Name or Other Default>
  10. Comments: Logins for ${Account::Account Name} dropped by ${Logins over Past 3 Months} (Type @ to use tokens)
  11. Criteria: Click the +Criteria button and add - Logins over Past 3 Months / less or equal / value / -25
    • NOTE:  This example uses an additional criteria to filter out some false positives (avoiding 100%).  Know your data; this should not be necessary.
    • The negative value represents a decrease/decline in percentage (e.g. -25%)

Click "Save"

Step 2 - Run and Review Results

Step 2a - Test Run


Perform a test run before executing the rule to determine outcome.  This case shows that ~11 CTAs will be created that match the criteria.


Step 2b - Run and Review CTAs

Run the rule.

  1. Select "Cockpit" from the tabs
  2. Filter on "Logins" and review results

The expected CTAs have been successfully created.

Additional Notes

This rule could be scheduled to run on a regular basis, quarterly or weekly.

  • Upon re-run, the rule would update existing CTAs that match criteria.
  • Additional actions could be put in place, such as to Close CTAs that no longer dip below the 25% threshold