Create an Aggregator based on a condition

This examples describes how to sum up only those peak areas that are greater than a certain value. To sum up the areas per compound, a composite group is used that is repeated on Compound_Name.

  1. Add the Compound Results table to the template.

  2. Open the Column Properties dialog of the Area column, and save the value as a variable.

    1. Under Calculation Variables, select Aggregator.

    2. Under Calculation Variable Name, enter a name. For example, AreaIf.

    3. Under Condition, double-click Expression....

    4. In the Expression Editor, enter the following expression: =Peak_Area > 3

    5. Save your settings.

  3. Underneath the table, add a text field that shows the sum of all areas that meet the condition. Use the following condition: =Sum(AreaIf)

  4. Add another text field that contains the Clear function: =Clear(AreaIf)

  5. Clear the Visibility check box for the text field with the Clear function.

  6. Select the table and both text fields, and create a composite group.

  7. Repeat the composite group on Compound_Name.

For each compound, the generated template will show a table with all injections, and a textbox with the sum of peak areas. The sum is based on all peak areas greater than 3.