Use a variable with a unique key

The following example describes how to create a table that compares a compound's retention time in each sample with the average retention time.

To prepare the variable:

  1. Make sure that variables are activated in your report template (see Activate the use of variables).

  2. Add two text fields to the template.

  3. Select the two text fields and click to create a composite group.

  4. Repeat the composite group on Compound_Name.

  5. In the first text field, enter a static text. For example, RT Average.

  6. In the second field, enter an expression for the average retention time: =Avg(Peak_RetentionTime)

  7. Save the expression of the second field as a variable. Use the following settings:

    • Calculation Variables: Variable

    • Calculation Variable Name: For example, VarRTAverage

    • Unique Key Value: =Compound_Name

    In the Unique Key Value setting, you must use the same value as you used for repeating the composite group

To use the variable:

  1. Underneath the composite group, create a Compound Summary table.

  2. Add a table column with the following expression: =Peak_RetentionTime - VarRTAverage(Compound_Name)