Add Expression or Edit Expression Dialog Box
The Add Expression dialog box allows you to create a computed expression used in a report. The Edit Expression dialog box allows you to edit such a computed expression. In a report, computed expressions can be used to do the following:
• If your report includes numeric fields, you can perform arithmetic calculations between one or more numeric fields and display the results in the report. For example, if your report currently displays a list of Project items, you could calculate the difference between the Actual Budget and Estimated Budget fields for each Project item and display the values in a new field called Over/Under Budget. The arithmetic calculation behind theOver/Under Budget is the computed expression.
• If your report includes fields used as summary values, you can perform aggregate computations on these fields. Aggregate computations allow you to add numeric field values, calculate the average of multiple numeric field values, retrieve the smallest or largest numeric field value in a group of items, or count the number of items returned by an existing query. For example, if your report groups Project items by state and includesActual Budget andEstimated Budget fields, you could display the totals for theActual Budget andEstimated Budget fields in each state grouping.
1. In the Expression Name field, type a name for the computed expression as it will display in the report, for example, Over/Under Budget. If you do not define a name, the computed expression in the Expression field displays.
2. In the Expression field, create a computed expression that incorporates numeric fields from the Selected list. For example, typing: ("Actual Budget" - "Estimated Budget")calculates the difference between theActual Budget andEstimated Budget fields for each Project item and displays the values in the report.
If you are creating an aggregate expression, typing sum("Actual Budget") adds the Budget fields in each state grouping of Project items to display a total actual budget by state.
3. From the Display Pattern list, select or type a display pattern for the value of the computed expression as it will display in the report, for example, $#,###.
4. To save the computed expression, click OK.