Table Column Calculations

You can configure tables to provide calculations. Table calculations are available dynamically--using the Table Calculations Options button in the toolbar--or you can configure them to automatically provide calculations for columns and objects.

For information on dynamic table calculations, see Making Column Calculations.

The following topics are discussed:

About Table Calculations

Depending on how you define the pagination setting, calculations are given per page, or for all items in the table. The calculation section header shows a count of the number of objects displayed on the page or in the table. You can use column values to show sum, average, maximum, minimum, median, and standard deviation values. You can apply one or more calculation types to each column. The results display at the bottom of the table.


  • You can perform calculations only on numerical values. To perform calculations on a column of string attributes that have numerical values, set format=numeric in the table column.
  • Null or empty rows are considered as a value of zero. This allows you to perform calculations on data sets that may be missing values for some rows.
  • You can perform more than one calculation on the same column. For example, a column may have a sum and an average specified for it. This results in two rows in the calculation section, one for each.
  • Place the sum calculation as the first calculation in the section at the bottom of the page. This prevents confusion about what the total represents.
  • Page calculations are optional. You can configure it so that only overall calculations are performed and shown them only on the last page of the listing. By default, page level calculations are disabled.
  • By default, the Table Calculations Options button displays in the toolbar for read-only (view mode) tables any time the table has numeric columns. You can hide the button by passing calculations = false to emxTable.jsp.

If the column contains data for an attribute configured with a dimension, ENOVIA Business Process Services uses the normalized values (the values stored in the database) to perform and display the calculations.

Table Item Counts

All configurable tables show a count of the number of objects used in the calculations in the calculation section header. For page calculations, it shows the number of items shown on the current page. If table pagination is off, then it shows the count of all objects across all pages. This clarifies the scope of the calculations displayed on the page. For example:


  • table page 1 has 10 objects
  • table page 2 has 10 objects
  • table page 3 has 5 objects

If pagination is on and you are looking at page 2, then the item count is displayed as Page (10 items). If pagination is off, then the item count is displayed as All (25 items) in the final calculation section. To enable page level calculations, set the property emxFramework.ShowPageCalculations to true in emxSystem.properties. This setting is false by default.

Types of Calculations

All configurable tables can provide calculations on columns within the table. This includes the sum of values or the average of all values in the column. You can also show the maximum, minimum, median, or standard deviation of the column.

You can apply calculations to any column in the table that contains numeric-only data except for the first column, which typically contains the object name. To perform calculations on a column of string attributes that have numerical values, you must set format=numeric in the table column. The calculation is performed only for the displayed data. For example:


  • table page 1 has objects 1 through 10
  • table page 2 has objects 11 through 20
  • table page 3 has objects 21 through 25

If pagination is on and you are looking at page 2, then the calculation is applied to objects 11 through 20 only. If pagination is off, then the calculation is applied to all objects (1 through 25).

The following rules apply to page level calculations:

Rule Description

Show on every page if paginated

If the listing is paginated, page calculations appear on every page.

Disable if pagination is disabled

Page calculations will not appear if pagination is disabled because they would be redundant with the final calculations.

Disable if only one page

Page calculations will not be shown in a paginated view if there is only a single page to be displayed.

Final calculations use all the values for all pages. This section always displays if any calculation settings are enabled, and appear on the last page of the listing. The following example shows a page layout that includes several page level calculations.



The following shows an example of both the page level calculations and the final calculations shown at the end of the table.



Calculation Settings

You can define the following settings for any numerical column in the table. Labels display in the first column of the listing that is not a checkbox, a radio button, or an icon image. The label column spans the remaining columns up to the first column that contains a calculation. The labels listed in the following table display by default with each of the calculation types.

Setting Name Values Description Label

Calculate Sum

true false

When True, displays the total of the column values.

Total

Calculate Average

true false

When True, displays the Average of the column values. This is calculated using the total of the values in the column divided by number of rows.

See Decimal Precision regarding the rounding of this calculated value.

Average

Calculate Maximum

true false

When True, shows the largest number of the column values.

Maximum

Calculate Minimum

true false

When True, shows the smallest number of the column values.

Minimum

Calculate Median

true false

When True, displays the middle number of the column values. If there is even number of values, the average of the two middle values displays.

See decimalprecision for information about the rounding of this calculated value. The median value for the odd number of rows is not rounded since no calculation is done.

Median

Calculate Standard Deviation

true false

When True, displays the standard deviation of the column values. The formula used for standard deviation is:

sd = square root [sum( x - xbar)^2/ (N-1)]

where

N is the total number of elements.

xbar is the mean of the column values

See decimalprecision regarding the rounding of this calculated value.

Standard Deviation

Decimal Precision

For total, maximum and minimum table column calculations, the system does not round the value. Average, median and standard deviation calculations involve division of numbers so rounding is done when necessary. In emxSystem.properties, the property emxFramework.TableCalculations.DecimalPrecision defines how many digits follow the decimal point when rounding. By default, the calculated value is rounded to 5 digits after the decimal point if the result contains more than 5 digits after the decimal point. For example, if the calculated value is 25.1234562, then the value would be rounded to 25.12346.