How to include a computed column in a report
Summary
You can display a value for a column of a list view report that is computed from other columns.
Note: this method is available for Process Commander Versions 5.4 and earlier only.
For example, if there are properties named Width and Height, you could include a column named Area computed as Width times Height. In addition, for summary views, you can specify a column that counts, totals or averages work objects for properties in the report.
Suggested Approach
Computed columns in list views
- Before you begin, identify the properties whose computed value will be displayed in a column of your list view. In the example, the properties are OrderTotal and QuantityTotal. They will be used to show the average price per unit. The figure shows the properties listed in the Application Explorer tree along with their declarative expressions.
- Create a property alias rule to define the computed column. The Property Alias rule should be created in the same class as the list view class. In the example, the alias rule is ComputedAverage.
- Enter the Alias Reference. This is the expression used to compute the two property values.
- Choose the Resulting Property Type from the drop-down list.
- In the Category field, choose Expression from the SmartPrompt list.
- Create a list view that includes the properties whose value will be computed. Enter the properties in both the Content and Display Fields tabs.
- In the Display Fields tab, create a new row in the Show These Fields section, Field column.
- Click the spyglass-shaped Search icon () next to the field.
- In the Pick an Expression window, select the new property alias expression, then click Apply.
- Enter a Field Label for the column head. In the example, the computed column is ComputedAverage.
- Click the Save icon.
- Click the Run icon. The report displays with the new computed column.
Computed columns in summary views
To include a computed column in a summary view:
- Create or edit a summary view and specify the Group By field to display.
- In the Fields section of the Content tab, choose a Function from the drop-down list. In the example, the report will display the count of the orders and the average total for purchase orders.
Note: For the Count Distinct, Sum, Average, Min, and Max functions, you must specify a property in the Field field. Make sure that the property is exposed as a column. To expose the property, see How to expose a work object property as a column and update data views. - Enter a text Caption to display as a column head.
- Click the Save icon.
- Click the Run icon. The report displays with the specified computed column and column head.