# Create a calculated field

Perform the following steps to create a calculated field:

1. Select the **Data** tab in the Interactive Report in which you want to add a calculated field.
2. Navigate to the bottom of the **Data** tab, locate the **Calculated Fields** entry.

   ![Data tab with Calculated Fields](/files/txy3GQxasVECyMl5MJ5m)
3. Click the plus sign on the **Calculated Fields**.

   The **Create Calculated Field** dialog box appears.

   ![Creat Calculated Field dialog box](/files/HTEIqbbEUWlBN7F0Bb77)
4. Enter the values as for your calculated field as described in the following table:

| Field             | Description                                                                                                                                                                                                                      |
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Display Name**  | Enter the name of the calculated field you want displayed.                                                                                                                                                                       |
| **Category**      | Select the category of the function.                                                                                                                                                                                             |
| **Select Fields** | Select the fields to use in the formula.                                                                                                                                                                                         |
| **Functions**     | Select the formula function to apply in the calculated field by double-clicking the function name. The function will appear in the **Formula** field. See the **Pentaho Report Designer** document for common formula functions. |
| **Formula**       | Edit your formula field to your specifications.                                                                                                                                                                                  |
| **Data Format**   | <p>Select the data type for the calculated field you have created. The values are:</p><ul><li>Numeric</li><li>Date</li><li>Other</li></ul>                                                                                       |
| **Description**   | Displays the description of the selected function                                                                                                                                                                                |
| **Return Type**   | Displays the return type of the selected function. For example, `SUM(2, 3)` will return an integer type, while `CONCATENATE("A", "B")` will return a string type.                                                                |

5\. Click \*\*OK\*\*

```
The calculated field is added to the list in the **Data** tab.
```

6\. (Optional) Right-click the calculated field to open a menu with the following options:

```
-   **Edit**: Select to edit the calculated field formula.
-   **Delete**: Select to delete the calculated field.
-   **Add To Report**: Select to add the calculated field to the columns in the report layout.
-   **Add To Groups**: Select to add the calculated field to the groups in the report layout.
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.pentaho.com/pba/pentaho-interactive-reports-cp/use-calculated-fields-in-pentaho-interactive-reports/create-a-calculated-field.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
