Skip to content
Corridor V1.26.03 is out, see what's new

Register a Data Aggregate

Ask AI
TL;DR

Compute a value across multiple rows (like “max DPD in the last 6 months”) and register it as an Aggregated Data Element. Tick Is Aggregated on the Data Element form, point at one or more source tables, and write the aggregation in Python, Pandas, or Spark.

An Aggregated Data Element is one whose value is computed across multiple rows rather than read from a single column. Use it when the value you need has to be calculated across records, for example counting an account’s transactions, taking the max DPD over the last 6 months, or rolling Account rows up to a Customer.

Simple Data ElementData Aggregate (this page)
Maps fromA single columnMultiple rows across one or more tables
Use whenThe column value is ready to use as-isYou need to compute something across records
Exampleannual_income from app_tableMax DPD in the last 6 months: the highest days_past_due across the last 6 rows in account_performance

Follow these steps to register a Data Aggregate.

On the Data Vault → Data Element page, click + New Data Element.

A name prompt opens first. Enter a descriptive name for the Data Element (for example, Total Deposit Amount (Last 90D)) and confirm to land on the full Data Element form.

Set the Data Type * - the output type of your aggregation (for example, numerical for a count or sum, boolean for a flag).

Fill in the Alias and Entity. See Common Registration Info.

Tick Is Aggregated. This switches the Definition section into aggregation mode, revealing an Input Type editor in place of the Source Column dropdown.

  • Source Tables * - one or more tables linked to the entity. Each chosen table becomes a variable in the editor: a table aliased account is referenced as account in code.
  • Source Columns * - the specific columns from those tables that your aggregation reads. Each one is exposed inside the corresponding table variable.
  • Input - any reusable global function registered on the platform that the aggregation should call.
  • Input Type - pick the language used for the aggregation (Python, Pandas, or Spark), then write the logic in the editor below.
Definition section for an aggregated Data Element showing Source Tables, Source Columns, and the Definition Input Type selector.
Source Tables and Source Columns feed the aggregation; the Input Type selector picks the language.

When you set Entity to Customer, and pick account (an Account-level table) as the source, Account rolls up to Customer. The platform groups Account rows by Customer before handing them to your code. Python and Pandas receive the data already filtered to one customer’s rows, so you write logic for a single entity. Spark receives the full source table and you must do the groupBy('customer_id') yourself, returning a DataFrame keyed by the entity.

Pick the input language that fits how you want to work with the data:

Definition editor with Python selected as the Definition Input Type.
Python Input Type exposes each table as a dictionary of lists, already filtered to the current entity.

When you select Python as the Input Type, each source table is exposed as a dictionary of lists, sliced to the rows belonging to the current entity. Each column lookup returns a Python list. You can import standard libraries (numpy, math, datetime, etc.) inside the editor.

Example 1: Total number of accounts for customer

Inputs:

  • Source Tables: account
  • Source Columns: account_id

Only account_id is selected, so that is the only key available inside account. The platform hands your code a dictionary that looks like this:

account = {
'account_id': [101, 102, 103],
}

Then your aggregation runs on top of it:

# `account` is a data dictionary
return len(set(account['account_id']))

Example 2: Default in the next 12 months of application

Inputs:

  • Source Tables: account, account_performance
  • Source Columns: account.account_application_date, account_performance.record_date, account_performance.charge_off_amount

Each table is its own dictionary, with one key per selected column. The platform hands your code the data sliced to one application’s rows:

account = {
'account_application_date': ['2024-01-15'],
}
account_performance = {
'record_date': ['2024-04-01', '2024-08-15', '2025-03-01'],
'charge_off_amount': [None, 500, None],
}

Then your aggregation runs on top of it:

import datetime
# sum charge_off_amount for records within 1 year of `account_application_date`
application_date = account['account_application_date'][0]
total_charge_off_amount = 0
for date, co_amt in zip(
account_performance['record_date'],
account_performance['charge_off_amount'],
):
if (
date >= application_date
and date - application_date < datetime.timedelta(days=365)
and co_amt
):
total_charge_off_amount += co_amt
# default flag if total_charge_off_amount > 0
if not total_charge_off_amount:
return 0
elif total_charge_off_amount > 0:
return 1
else:
return 0

Example 3: Total deposit amount in the 90 days before application

Inputs:

  • Source Tables: application_table, application_cashflow_transactions
  • Source Columns: application_table.loan_applied_date, application_cashflow_transactions.transaction_date, .amount, .transaction_type

The Entity here is Application, so both dictionaries are sliced to one application’s rows. The platform hands your code the data like this:

application_table = {
'loan_applied_date': ['2025-04-01'],
}
application_cashflow_transactions = {
'transaction_date': ['2025-01-15', '2025-02-20', '2025-03-10'],
'amount': [200, 500, 300],
'transaction_type': ['CREDIT', 'DEBIT', 'CREDIT'],
}

Then your aggregation runs on top of it:

import datetime
loan_applied_date = application_table["loan_applied_date"][0]
window_start = loan_applied_date - datetime.timedelta(days=90)
total_deposits = 0
for txn_date, amt, txn_type in zip(
application_cashflow_transactions["transaction_date"],
application_cashflow_transactions["amount"],
application_cashflow_transactions["transaction_type"],
):
if (
txn_type == "CREDIT"
and amt is not None
and window_start <= txn_date.date() < loan_applied_date
):
total_deposits += amt
return total_deposits

Fill in the Properties (Description, Permissible Purpose, Group, and Keywords), then click Create at the bottom right. The Data Element is saved as a draft and you land on its details page.

Once registered, the Data Aggregate can be used across Features, Models, and Policies just like any other Data Element. You can also run a simulation on it (with reports for summary statistics, distributions, and percentage of missing values) and trace its lineage to every downstream object.

Next steps:

  • Build a Feature on top of this Data Aggregate.
  • Send it for approval so it can be used outside your draft workspace.
  • Need a value that reads straight from one column (like annual_income)? Register a simple Data Element instead.