Create an Aggregation Comparison Check
Step-by-step tutorial for creating an Aggregation Comparison check between a target container and a reference container. For what each property means and how the rule evaluates the data, see the How It Works page.
Permission Required
You need the Author team permission on the datastore to create an Active check, or Drafter to create it as a Draft. See the Permissions page for the full matrix.
Show me how
The app can walk you through this. Click Show me how in the check creation form's header, or press H while it is open, and the Add a Check walkthrough highlights each step while you fill in the real form.
Field reference
The Authored Check Details form is organized in the sections below. Fill them in as you follow the Steps.
Target
| Field | Required | Type | Description |
|---|---|---|---|
| Associate with a Check Template | Toggle | Links the check to a Check Template. Enabling it replaces the Rule Type dropdown with a Template dropdown where you pick an existing template, which then controls the check's properties. When off, you configure everything on this form. | |
| Rule Type | Option | The validation logic to apply. Select Aggregation Comparison for this check. Shown only while Associate with a Check Template is off. | |
| Table / File | Option | The target the check runs against. The label follows the datastore, reading Table on a database and File on a file system. Locked after the check is saved. Aggregation Comparison has no Field picker, since both sides are expressions. | |
| Filter Clause | Text | A SQL WHERE expression applied to the target container before its aggregation runs. |
|
| Custom Anomaly Description | Toggle | Appears under Advanced, at the end of this section, once a table is selected. It has no effect on this rule, because the option replaces the message on Record Anomalies and Aggregation Comparison emits Shape Anomalies only. |
Properties
| Field | Required | Type | Description |
|---|---|---|---|
| Aggregation | SQL | The target aggregation expression, evaluated against the target container. Must produce a single aggregate value (for example, SUM(amount), COUNT(*), ROUND(AVG(score), 2)). Accepts Check Variables. |
|
| Comparison | Option | The operator applied from the target to the reference. One of Less Than, Less Than Or Equal To, Equal To, Greater Than Or Equal To, or Greater Than. See Comparison Operators for what each one asserts. |
Right Reference
| Field | Required | Type | Description |
|---|---|---|---|
| Datastore | Option | The datastore holding the reference container. Leave it empty to use the target's own datastore. | |
| Table / File | Option | The table or file holding the reference data. It can be the same one as the target. The label follows the reference datastore, the same way the target's does. | |
| Aggregation | SQL | The reference aggregation expression. Must also produce a single aggregate value. Accepts Check Variables. | |
| Filter Clause | SQL | A SQL WHERE expression applied to the reference container before its aggregation runs. Accepts Check Variables. |
Ownership
| Field | Required | Type | Description |
|---|---|---|---|
| Owner | Option | The user responsible for the check. Already filled in with the check creator. | |
| Anomaly Assignee | Option | The user automatically assigned to anomalies the check produces. |
Metadata
| Field | Required | Type | Description |
|---|---|---|---|
| Description | Text | A plain-language description of what the check enforces. Supports Markdown formatting: click the field to open the Markdown editor. Click the Apply suggested description button for a suggestion based on the rule type. | |
| Tags | Option | Tags applied to the check for filtering and organization. | |
| Additional Metadata | Key-value | Custom key-value pairs, typically links to catalog entries, tickets, or governance records. |
No Pass Criteria section
Aggregation Comparison does not use coverage, so the form shows no Coverage slider. The check asserts a single relationship between two aggregates: either it holds or it does not.
Let AgentQ fill in the form
When AgentQ is configured for your deployment, the Check Assistant panel in the check form can author the check for you: describe the reconciliation in plain language (for example, "order totals must match the line-item roll-up") and it proposes a configuration you can apply to the form. Review the filled-in fields, then Validate and Save as usual.
Steps
Each field is described in the Field reference above.
Step 1: Select the source datastore from the left menu, then click the Checks tab.
Step 2: Click Add in the top-right corner and select Check from the dropdown. The Authored Check Details form opens.
Step 3: Select Aggregation Comparison in the Rule Type dropdown.
Step 4: Fill in the remaining Target fields: the target table or file and, optionally, a Filter Clause that scopes the target aggregation.
Step 5: Under Properties, write the target Aggregation expression and pick the Comparison operator.
Step 6: Fill in the Right Reference panel: the reference Table / File (and its Datastore when it lives elsewhere), the reference Aggregation, and an optional Filter Clause for that side.
Step 7: Fill in the Ownership and Metadata sections. Only the Description is required.
Step 8: Click Validate to test the rule against the selected data without saving it. A success message confirms the rule can run on that data. If validation fails, see Troubleshooting.
Step 9: Click Save. A success message confirms that the check was created.