You want the agent to detect cases where the actual value of returned products is greater than the threshold value that the person running the agent defines.
Also, you want to see what parameter value would return an event list of between 5 and 10 items from the current data.
Click the Detail tab.
In the Insertable Objects area, click
the source tab .
Expand Returned items (query).
Under Returned items (query), expand Returned items.
Click the Return quantity measure item, and drag it to the end of the expression.
After the source item you just inserted, type
> 0 and
On the data items tab ,
click the order_item_return_value_calc calculation
that you defined previously
, and drag it to the end of the expression.
At the end of the expression, type a greater than symbol:
>
Click the parameters tab ,
click the total_return_value parameter that
you defined previously
, and drag it to the end of the expression.
At the end of the expression, type
and
On the source tab, under Returned items (query), expand Return reason.
Click Reason description, and drag it to the end of the expression.
At the end of the expression, type
in
If you want to include only the description types you want, do the following:
On the source tab, under Return reason, click Reason description.
Above the Expression box, click the select
value button .
In the Select Value window, use Shift+click to select Incomplete product, Unsatisfactory product, and Defective product.
Click the insert button ,
and click OK.
The detail expression appears as follows:
[Return quantity]>0 and [order_item_return_value_calc]>?total_return_value_for_item? and [Reason description] in ('Defective product','Incomplete product','Unsatisfactory product')
Do the following to see whether an event list of between 5 and 10 items is returned when the total return value calculation exceeds $17,000:
From the Actions menu, click Preview.
On the report viewer Prompt pages, in the Provide a number box, type
17000
Click OK.
The next step in the creating an agent tutorial is to add a report task.