Rule action: Item group rules
Used for: Calculations on group level rather than individual item level.
Used in: "THEN"-statements and "ELSE"-statements.
General improvement
The four new rules are all a subset of rules under the parent rule called "Calculate item group".
You can use these rules without having to group the items beforehand. You can use these rules on groups of items that share values in a certain field. The most obvious one is item_group_id, but you can also create your own groups of items.
Count items
The "count items" rule counts the number of products/items within a certain group.
As shown in the app, first choose a mutual id or some field that identifies the group (for example, item_group_id). Then select the rule and choose a field where the result of the calculation will be stored.
The result of this rule will always be a number (the number of products in the product_group).
Example use cases:
Group vacancies by
branch + cityand count how many vacancies a branch has in a specific area.Group real estate by
type of house + areaand count how many houses of that type exist in an area.For travel, calculate the number of accommodations available per city or tickets on a route.
Calculate sum
The "calculate sum" rule computes the sum of a specific numeric field for all items within a group.
Workflow:
Choose the group identifier (e.g.,
item_group_id).Select the "calculate sum" rule.
Select the numeric field to sum (for example,
Stock).
The result is the total amount across the group. For example, if you have 10 items in the group and each has stock = 3, the result will be 30.
Find highest / lowest value
There are two complementary rules: "find highest value" and "find lowest value". Each finds the extreme value of a specified field across all items in the group and stores that value in a chosen field.
Important: Click the Sort numbers button in the bottom right corner of the THEN-STATEMENT to find the highest or lowest value of the intended field.
Use cases:
Flights: find the lowest price among various dates/offers and advertise "available from [lowest price]".
Product advertising: find the lowest price within a brand or category and use it in promotional text like "starting from [lowest_price_of_brand]".
Note: Unlike a deduplicate rule that would keep only the highest or lowest item, these rules keep all items and simply store the highest/lowest value for the group.
The "find highest value" rule works the opposite way (finds the maximum value).
Last updated
Was this helpful?