## Overview:

The advanced **DocFormula** rules configure the summary calculations on a document’s Detail tab. Formulas and filters follow .NET Data Expression syntax.

The **DocFormula** rule group is found in the Rules Maintenance tool on the System Admin Dashboard. Each rule in the group consists of a rule name, a filter value (which can be blank) and a result value.

## Filter Values:

*Any Doc type*

The **DocFormula** rules accept any Doc type (as defined in the Doc Types tool and appearing on the filter drop-down) as the filter value.

## Result Values:

*Varies*

Result values for the **DocFormula** rules depend on the rule and are indicated within the description of each rule. A few rules are enabled and disabled through a checkbox in the result value, for example:

## Rules:

Generally, there are three rules for each computation to provide the formula, filter and table. The formula should be relative to the specified table, its PARENT and CHILD values.

#### cmpContractAmount

Specifies (in the result value) the formula for computing the Total Contract Amount. The default is **SUM(ContractAmount)**.

#### cmpContractAmount:Filter

Specifies (in the result value) the filter for computing the Total Contract Amount. The default is **TRUE** (meaning all records). PARENT.Billable is often used.

#### cmpContractAmount:Using

Specifies (in the result value) the table for computing the Total Contract Amount. See **cmpExpenseAmount:Using** (below) for a list.

#### cmpExpenseAmount

Specifies (in the result value) the formula for computing the Total Expense Amount. The default is **SUM(ExpenseAmount)**.

#### cmpExpenseAmount:Filter

Specifies (in the result value) the filter for computing the Total Expense Amount. The default is **TRUE** (meaning all records).

#### cmpExpenseAmount:Using

Specifies (in the result value) the table for computing the Total Expense Amount.

**DocItem**= use the DocItem table.**DocItemTask**= use the DocItemTask table (default).**DocInclusion**= use the DocInclusion table.**DocMeetingAttendees**= use the DocMeetingAttendees table.**ProjectFBDetail**= use the budget and forecast snapshot (the**BudgetConfig | BFASnapshot**rule =**128**is required).**SPRLineDetails**= use the SPRLineDetails table (for Commitment, Pay Request, CCO and Production units).

#### cmpOriginalEstimate

Specifies (in the result value) the formula for computing the Total Estimate. The default is **SUM(OriginalEstimate)**.

#### cmpOriginalEstimate:Filter

Specifies (in the result value) the filter for computing the Total Estimate. The default is **TRUE** (meaning all records).

#### cmpOriginalEstimate:Using

Specifies (in the result value) the table for computing the Total Estimate.

**DocItem**= use the DocItem table (default).**DocItemTask**= use the DocItemTask table.**DocInclusion**= use the DocInclusion table.**DocMeetingAttendees**= use the DocMeetingAttendees table.**ProjectFBDetail**= use the budget and forecast snapshot (the**BudgetConfig | BFASnapshot**rule =**128**is required).**SPRLineDetails**= use the SPRLineDetails table (for Commitment, Pay Request, CCO and Production units).

#### cmpOriginalQuote

Specifies (in the result value) the formula for computing the Total Quote. The default is **SUM(OriginalQuote)**.

#### cmpOriginalQuote:Filter

Specifies (in the result value) the filter for computing the Original Quote. The default is **TRUE** (meaning all records).

#### cmpOriginalQuote:Using

Specifies (in the result value) the table for computing the Original Quote.

**DocItem**= use the DocItem table (default).**DocItemTask**= use the DocItemTask table.**DocInclusion**= use the DocInclusion table.**DocMeetingAttendees**= use the DocMeetingAttendees table.**ProjectFBDetail**= use the budget and forecast snapshot (the**BudgetConfig | BFASnapshot**rule =**128**is required).**SPRLineDetails**= use the SPRLineDetails table (for Commitment, Pay Request, CCO and Production units).

#### cmpRevenueAmount

Specifies (in the result value) the formula for computing the Total Revenue Amount. The default is **SUM(RevenueAmount)**.

#### cmpRevenueAmount:Filter

Specifies (in the result value) the filter for computing the Total Revenue Amount. The default is **TRUE** (meaning all records).

#### cmpRevenueAmount:Using

Specifies (in the result value) the table for computing the Total Revenue Amount.

**DocItem**= use the DocItem table.**DocItemTask**= use the DocItemTask table (default).**DocInclusion**= use the DocInclusion table.**DocMeetingAttendees**= use the DocMeetingAttendees table.**ProjectFBDetail**= use the budget and forecast snapshot (the**BudgetConfig | BFASnapshot**rule =**128**is required).**SPRLineDetails**= use the SPRLineDetails table (for Commitment, Pay Request, CCO and Production units).

#### CostImpact

Specifies (in the result value) the formula for computing the Cost Impact. The default is **SUM(ExpenseAmount)**.

#### CostImpact:Filter

Specifies (in the result value) for filter for computing the Cost Impact. The default is **PARENT.Billable**.

#### CostImpact:Save

Specifies (in the result value checkbox) whether **DocRevision.CostImpact** should be updated with the result of this computation when the document is saved.

*unchecked*= No (default).*checked*= Yes.

#### CostImpact:Using

Specifies (in the result value) the table for computing the Cost Impact.

**DocItem**= use the DocItem table.**DocItemTask**= use the DocItemTask table (default).**DocInclusion**= use the DocInclusion table.**DocMeetingAttendees**= use the DocMeetingAttendees table.**ProjectFBDetail**= use the budget and forecast snapshot (the**BudgetConfig | BFASnapshot**rule =**128**is required).**SPRLineDetails**= use the SPRLineDetails table (for Commitment, Pay Request, CCO and Production units).

## Additional Comments:

This is an advanced rule. Formulas and Filters follow .NET Data Expression Syntax. See the distributed rules for samples and consult your implementation specialist for help.

**KBA-01521; Last updated: September 19, 2017 at 13:35 pm **