Administering : Managing business rules and expressions : Business rule definition examples : ListAttributeSum example
  
ListAttributeSum example
To calculate the sum of an attribute value in selected elements from a linklist or incoming links attribute, you can use the List AttributeSum business rule. In this example, a project manager uses the ListAttributeSum business rule to calculate the total cost for the implemented business needs in a project.
Note ListAttributeSum business rule is deprecated and replaced by the List business rule in Focal Point® 6.6.
As a project manager, you must monitor the total cost of the business needs implemented in your project. New or planned business needs might also be linked to your project, but for this particular purpose, you are interested only in implemented business needs. Implemented business needs have the status To be tested, Verified, or Completed.
To include only the implemented business needs in the calculation, use a view that is based on the To be tested, Verified, and Completed statuses. By adding listen_to parameters, the total cost of the project is automatically recalculated when the cost or status are updated in a linked business need.
Important: The data in this topic is an example. When you set up this business rule, the attribute IDs, view ID, and user ID must be collected from your current installation of Focal Point®.This example uses the following attributes, view definition, and user:
 
Module
Attribute name
Attribute type
ID
Projects
Total Cost
Integer
This attribute is the business rule container.
Not used
Projects
Business Needs
Incoming Link
Displays links from elements in the Business Needs module, and might contain links to business needs of any status.
51
Business Needs
Cost
Integer
23
Business Needs
Status
Choice
Choice items might include New, Planned, To be tested, Verified, and Completed. This attribute is used for the view.
Not used
View name
Module
Visible attributes
View rules
View ID
Implemented Business Needs
Business Needs
Title
Status
Cost
type is a folder is false AND Status is (To be tested OR Verified OR Completed)
38
User name
Access level
User ID
Admin
Workspace administrator
46
To view the total cost for the implemented business needs in this example, enter this business rule in the Total Cost attribute in the Projects module:
=ListAttributeSum("51","38", "23", "46",
'Business Needs', "listen_to=Cost", "listen_to=Status",
"listen_to=type is a folder")
See also
ListAttributeSum business rule
Business rule definition examples