You want to define a calculation named total_return_value_calc that you can insert into an event condition. This calculation must determine the total value of each order returned.
From the Insert menu, click Calculation.
In the Name box, type
order_item_return_value_calc
In the Expression box, do the following:
In the Insertable Objects area, click the functions tab and expand Summaries.
Click the total function item, and drag it to the Expression box.
In the Insertable Objects area, click the source tab and expand Returned items (query).
Under Returned items (query), expand Returned items.
Click the Return quantity measure item, and drag it to the Expression box.
After you insert the source item, type for.
Under Returned items (query), expand Order.
Click the Order number item, and drag it to the end of the expression.
After you insert the source item, type a closing parenthesis:
)
The calculation expression is defined as follows:
total([Returned items (query)].[Returned items].[Return quantity]for[Returned items (query)].[Order].[Order number])
Click OK.
The calculation appears as a calculation icon on the data items tab.
The next step in the creating an agent tutorial is to specify an event condition.