Published at: 2026-09-17
Aggregation rules overview
Learn what aggregation rules are used for.
Overview
Aggregation rules calculate document fields into result values. Pricing policies and rebate rules can reference these aggregation values.
Business value
Promotions and rebates often need to calculate amounts and quantities. The calculation target can be order details, historical orders, or product combinations.
Aggregation rules store these calculation results as reusable aggregation values.

Key concepts
| Concept | Definition | Typical use |
|---|---|---|
| Aggregation rule | A configuration that calculates document object fields by rule. | Calculate order amounts, quantities, or product combinations. |
| Standard aggregation value | A calculated result that can be used as a condition. | Determine whether an order meets promotion or rebate conditions. |
| Product combination | An aggregation result type used for bundle promotions. | Identifies the promoted product scope and serves as an order condition. |
| Current-order aggregation | Aggregates detail-object data in the current document. | Calculate current order products or quote details. |
| Historical aggregation | Aggregates master-object or detail-object data from historical documents. | Calculate historical order amounts or quantities for an account. |

Where aggregation rules can be used
Aggregation rules can be used in these businesses:
| Business | Usage |
|---|---|
| Pricing policy | Used as a rule condition to determine whether a promotion runs. |
| Pricing policy | Used as a threshold condition in the execution result to determine benefit multiples. |
| Rebate rule | Used as a rebate usage condition to determine whether an order can use a rebate. |
| Rebate rule | Used as a threshold calculation condition or as a value in a formula. |
Data scope
An aggregation rule first defines what to calculate, and then uses data scope to limit the target records.
The result only includes data that meets both the basic configuration and the aggregation conditions.
Data scope can limit product scope. For example, it can calculate only the quantity or amount of order products in a specified product category.

Common scenarios
- Total quantity of products in a category in the current order.
- Historical total order amount for an account in January.
- Cleaning product bundle amount reaches 100 CNY.
- Milk tablets, milkshake, and coconut juice bundle quantity reaches 20 boxes.