Skip to main content

Can anyone advise on how do I built the query for 
Accounts that do not fall in the given range of created date?
Like I dont want accounts that have been created in last 3month?

Here’s a quick overview (from Gemini). Hope this is helpful! 😀

 

How to Use Dates in Query Logic

You generally have two ways to work with dates when setting up filter criteria:

  • Specific Dates: You can pick an exact calendar date. This is useful for one-time queries or when you have a fixed, important date, but it's less common for automation.

    • Example: Renewal Date | equals | 2025-12-31

  • Relative Dates: This is the most powerful and common method. Instead of a fixed date, you use a dynamic value relative to the day the query runs. This is what makes automation possible. Gainsight provides a rich set of options for this.

    • Example: You can filter for customers whose renewal is in the "Next 90 days" or whose last activity was in the "Last 30 days."

Key Concepts: "Rule Date" vs. "Today"

When working in the Rules Engine, you will see two important relative date options:

  • Today: This always represents the actual, current calendar date.

  • Rule Date: This represents the date for which the rule is scheduled to run. Most of the time, this will be the same as "Today." However, if you ever run a rule for a historical period (e.g., re-running last week's rule), Rule Date will be that past date, while Today would still be the current date.

Best Practice: For consistency and accurate historical runs, it's almost always better to use Rule Date in your rule criteria instead of "Today."

Example Scenario: Finding "At-Risk" Renewals

Let's say you want to create a Call to Action (CTA) for every customer whose renewal is coming up in the next 90 days.

Your query logic in a rule would look something like this:

  1. Fetch Data from: Customer object.

  2. Apply Filter Criteria:

    • Renewal Date | greater than or equal to | Rule Date

    • AND

    • Renewal Date | less than or equal to | addDays(Rule Date, 90)

This query effectively creates a 90-day rolling window, and any customer whose renewal date falls within that window will be pulled into your rule's action.

Some resources:

  1. Formula Fields in Rules Engine

    • What it covers: This is the most relevant article. It details the specific date formula functions you can use, like DateDiff and Add/Subtract Date. It also explains the crucial concept of "Rule Date" and how it's used in calculations.

  2. Advanced Operations in Gainsight Data Management

    • What it covers: This article provides a comprehensive table of date functions like Date Add, Date Sub, First Day of Week, etc., that are available in various parts of Gainsight, including the rules engine.

  3. Schedule and Execute Rules

    • What it covers: While this article is about scheduling, it's useful because it explains how to run rules for historical periods, which is where the distinction between Rule Date and Today becomes very important.

These documents are the official source and should give you everything you need for working with date values in Gainsight's query logic.


Hi ​@dayn.johnson  Thanks for the above info .
Say there are accounts and their create date.
I want to capture accounts that are not created in last 40 days.