With calculation variables, you can create a large variety of customized reports. Calculation variables offer you the possibility to store specific values or expression results under a specific name, and reuse the values in other report items in the same template.
There are different scenarios in which you can use calculation variables. Depending on the scenario, the calculation variables are referred to as Variable, Aggregator, Category Aggregator, or Custom Extractor:
With Variable, you can store any single numerical value.
With Aggregator, you can store a collection of single values.
With Category Aggregator, you can store a collection of collections.
With Custom Extractor, you can store the key/value pairs contained in the XML content of a complex custom field (for example, Injection_DiagnosticData or Sample_CustomFields).
To create a new calculation variable, you can either use the Summary Calculations feature of a table, or create a suitable expression for a field/table/matrix value and use the Save Expression Result As... function in the Expression Editor.
Once you have defined the variable, you can refer to it in all subsequent report items. You can not refer to a calculation variable in a report item preceding the one in which the variable is defined.
You can see a list of all calculation variables that are available for the current item in the Expression Editor under the Variables node. A list of all calculation variables used in the entire report template can be found in the Report Properties dialog.
The Report Properties dialog also allows you to rename existing calculation variables. The renaming includes both the definition and all expressions where the calculation variable is used.
See the following topics for more details on the calculation variable types.