Insert Calculated Field Dialog
- 2 minutes to read
The Insert Calculated Field dialog allows end-users to add new calculated fields to the Pivot Table as well as modify or remove the existing ones.
End-users can invoke the dialog by selecting the Calculated Field… item in the Fields, Items, & Sets drop-down menu. Add the Calculations Ribbon page group to the SpreadsheetControl to enable this menu (see the Getting Started topic for a demonstration on how to provide a Ribbon UI for the SpreadsheetControl).
In the dialog’s Name and Formula boxes, end-users can specify the name (PivotField.Name) and formula (PivotField.Formula) for a new calculated field.
The calculated field’s formula can contain constants and references to other fields in the PivotTable report. End-users can select the desired item in the Fields list and click the Insert Field button to include the field reference to the formula.
Clicking the Add button adds the new field to the data area of the PivotTable report.
End-users can modify the existing calculated field by selecting the desired item in the Name drop-down list and changing its formula. The calculated field’s name cannot be edited from the dialog.
Clicking the Delete button removes the selected calculated field.
Tip
Call one of the PivotCalculatedFieldCollection.Add method overloads to create a calculated field using the Spreadsheet API. Refer to the How to: Create a Calculated Field example for more details.