Published at: 2026-09-17

Configure aggregation rules


Define the aggregation calculation basis.

Overview

An aggregation rule first defines what to calculate. It then uses data scope to limit the target records.
The result only includes data that meets both the basic configuration and the aggregation conditions.

Before you begin

[!IMPORTANT] - Role permissions: You need permission to create and edit aggregation rules. - Prerequisite configuration: Confirm the calculation basis that pricing policies or rebate rules need to reference. - Business preparation: Define the calculation object, calculation field, time range, and data scope.

Configuration steps

  1. Go to the aggregation rule creation page.
  2. In basic information, select the aggregation type.
  3. Select the aggregation result type.
  4. In What to calculate, select the aggregation object.
  5. Select the aggregation field.
  6. If the aggregation type is Historical, select the aggregation dimension.
  7. Confirm the aggregation method.
  8. If the aggregation type is Historical, select the aggregation date field.
  9. If the aggregation type is Historical, set the time range.
  10. In Data Scope, configure aggregation conditions.
  11. Save the aggregation rule.
Create an aggregation rule
Aggregation result type settings
Data scope settings

Field descriptions

Field Description
Aggregation type Selects the document time scope to aggregate. Options include Current Order and Historical.
Aggregation result type Selects the aggregation value type. Different types can be used in different positions.
Aggregation object Selects the document object to aggregate.
Aggregation field Selects the field under the aggregation object.
Aggregation dimension Optional for historical aggregation. Available options include Account Name and Partner.
Aggregation method Selects the calculation method for the aggregation field. The default is Sum and cannot be changed.
Aggregation date field Optional for historical aggregation. Available options include Created On, Date Time, Last Modified On, and Date.
Time range Optional for historical aggregation. It limits the time range of the aggregation date field.
Data scope Further limits target records based on the basic calculation configuration.

Difference between current-order and historical aggregation

Aggregation type Available aggregation objects Usage
Current Order Order products and quote details. Calculates only detail objects in the current document.
Historical Sales orders, quotes, order products, and quote details. Calculates historical master objects and detail objects.

Configure data scope

Data scope further limits the target records. The system only calculates data that meets both the basic configuration and aggregation conditions.
Example: To calculate the total amount of cleaning products in the current order, use this approach:
  1. Set aggregation type to Current Order.
  2. Set aggregation result type to Product combination.
  3. Set aggregation object to Order Product.
  4. Set aggregation field to Price Book Subtotal.
  5. Set the data scope to product name or category equals Cleansing.
Cleaning product bundle aggregation value

Bundle quantity example

Scenario: A、B and C reach 20 boxes in total and get three boxes as gifts. A must have at least one box for the promotion to run.
You need to configure two aggregation values:
Aggregation value Result type Data scope
A+B+C bundle quantity reaches 20 boxes Product combination Product name is in A、B、C.
A is greater than or equal to 1 box Standard aggregation value Product name is A.
Bundle quantity aggregation value
Single product quantity aggregation value

Expected result and verification

  1. Reference the aggregation rule in a pricing policy or rebate rule.
  2. Create a test order that meets aggregation conditions.
  3. Enter products, quantities, or amounts that meet the calculation scope.
  4. Execute the business document.
  5. Check whether the pricing policy or rebate rule matches by aggregation result.

Notes

  • Data scope is optional. Configure it based on business needs.
  • The current aggregation method defaults to sum and cannot be changed.
  • Product combination is only used for pricing policy bundle promotions.

Related topics

Submit Feedback