Custom Attributes

Last updated: February 25, 2026

Grid provides the ability to define custom attributes on your data models. Custom attributes allow you to extend your customer, subscription, or invoice models with additional fields derived from conditions or aggregations. Once defined, these attributes can be used in groupings, segments, or calculations, giving you more flexibility in how you analyze and report on your data.

For example, instead of filtering for "customers with unpaid invoices," you can create a single attribute and use it anywhere in your reporting. Similarly, rollup attributes let you capture important derived metrics like "total credits applied" or "first product purchased" that help drive deeper insights.

There are two types of custom attributes: Filter Attributes and Rollup Attributes.


Filter Attributes

A filter attribute creates a True/False flag on a model based on specified conditions. This is similar to creating a segment, but because the result is stored directly on the model, it provides greater flexibility in downstream analysis.

Key Components

  • Model: The model you want to write the attribute to (e.g., Customer, Subscription).

  • Label: The name of the attribute.

  • Filters: A set of conditions the model must satisfy to evaluate as True.

If the model has a one-to-many relationship (e.g., Customer → Invoices), you can specify whether any related records or all related records must meet the condition.

Examples

Example 1

  • Name: Has Unpaid Invoices

  • Explanation: Sets the attribute Has Unpaid Invoices to True if the customer has any invoices that are not paid.

  • Components:

    • Model: Customer

    • Label: Has Unpaid Invoices
      Filters: Invoice status is not equal to "Paid"

    • Evaluation: ANY related invoices must meet the condition

Example 2

  • Name: Active Customer

  • Explanation: Sets the attribute Active Customer to True if the subscription’s customer has a status of "Active."

  • Components:

    • Model: Subscription

    • Label: Active Customer

    • Filters: Customer status = "Active"


Rollup Attributes

A rollup attribute calculates a value on a model by aggregating data from related models. This enables you to create attributes such as totals, counts, or first/last values based on relationships.

Key Components

  • Model: The model you want to write the attribute to.

  • Label: The name of the attribute.

  • Aggregation Function: The function to use (e.g., SUM, COUNT, FIRST, LAST).

  • Rollup Model: The related model to aggregate (e.g., Invoices, Subscriptions).

  • Rollup Field: The field to aggregate.

  • Order By Model/Field: For FIRST or LAST functions, the model and field to determine order.

  • Filters: Conditions the related records must satisfy before being included in the aggregation.

Examples

Example 1

  • Name: Total Credits

  • Explanation: Sets the attribute Total Credits to the sum of all credits applied on invoices for a customer.

  • Components:

    • Model: Customer

    • Label: Total Credits

    • Rollup Model: Invoice

    • Rollup Field: Credits Applied

    • Aggregation Method: SUM

Example 2

  • Name: Active Subscriptions

  • Explanation: Sets the attribute Active Subscriptions to the total count of subscriptions for a customer where the subscription status is "Active."

  • Components:

    • Model: Customer

    • Label: Active Subscriptions

    • Rollup Model: Subscription

    • Rollup Field: (count of records)

    • Aggregation Method: COUNT

    • Filters: Subscription status = "Active"

Example 3

  • Name: First Product

  • Explanation: Sets the attribute First Product to the product from the earliest line item in a subscription, ordered by start date.

  • Components:

    • Model: Subscription

    • Label: First Product

    • Rollup Model: Invoice Line Item

    • Rollup Field: Product

    • Aggregation Method: FIRST

    • Order By Model: Invoice Line Item

    • Order By Field: Start Date