Field Functions
In the Calculation Editor pane, when the calculation type selected is Number, you can do one of the following to display a list of aggregate field functions that you can insert in the equation:
Click Field Functions.
Right-click in Calculation and select Insert Field Function.
List of Aggregate Field Functions
From the list of aggregate functions that is shown, you click the function to insert in the equation. When it appears in Calculation, the aggregate field function appears in red. Within the parentheses, you insert the data field on which to perform the aggregate function. To accomplish this, after ensuring that the mouse cursor is placed within the parenthesis, you click Data Fields and use the Insert Field window to select the field to insert. For more information, see Data Fields. The inserted data field appears in blue.
Sample Numeric Calculation
A tree rollup calculation allows values for a child item in an hierarchical tree to be aggregated to its parent. For example, a system tree typically consists of multiple levels of assembly and parts. For an assembly, the predicted failure rate values for child records are aggregated by default. For a part, which does not have child records, the aggregate value is zero. You can use tree rollup calculations to aggregate values for fields in the System Tree Items table and FMEA Tree Items table.
A few simple examples of tree rollup calculations follow.
AvgTreeRollup(UserValue1, FALSE)
MaxTreeRollup(UserValue2, FALSE) + User Value1
MinTreeRollup(UserValue1, FALSE) + 3
SumTreeRollup(UserValue2, FALSE) + User Value3
To insert a rollup function for Calculation, you click Field Functions and select it from the list of aggregate functions. The rollup function is inserted as shown in the following figure. In the calculation, the field function that you insert appears in red.
Rollup Function Inserted for Calculation
Before the comma and the value for the second parameter, which appears in purple and is explained below, you insert the data field on which to perform this function. To do this, you click Data Fields and use the Insert Field window, just as you do for other field functions. A data field always appears in blue.
Sample Rollup Calculation
The second parameter, which is named UseSpecifiedValue, allows you to indicate which assemblies should have their field values for child records aggregated and which should use their specified values. Because this parameter is a constant, it appears in purple.
If FALSE (default), values for the assembly’s child records are aggregated.
If TRUE, the specified value for the assembly is used.
The value for this second parameter is set to FALSE by default so that values for child records are aggregated. If you remove the value for this second parameter from the equation shown for Calculation, the value is assumed to be FALSE.To change the value to TRUE, you highlight FALSE and then either type TRUE or click Field Functions and select TRUE from near the bottom of the list of aggregate field functions. When UseSpecifiedValue is set to TRUE, then the specified value for the parent record is used.
If desired, you can enter a complex equation as the value for the second parameter, providing that it results in setting either a 0 for FALSE or a 1 for TRUE. A few examples of the equations you might enter using this second parameter follow.
AvgTreeRollup(UserValue1, TRUE)
MaxTreeRollup(UserValue2, UserValue2 > 50)
MinTreeRollup(UserValue1, UseSpecifiedValue = TRUE)
SumTreeRollup(UserValue3, RollupAvg(UserValue3, FALSE) < User Value3
While tree rollup calculations can be automatic, with very large trees, automatic calculations will be slow. Any filters that are applied to tree rollup calculations are ignored. Additionally, the result of a calculation containing a tree rollup function must be stored in a field in the tree. You cannot store the result in the child table.
Additional information about aggregate functions appears in the following topics: