Use calculated fields in Pentaho Interactive Reports

You can create calculated fields from fields in the data source. You can also build calculated fields from other calculated fields.

When you create a calculated field, the field appears in the Calculated Fields list. The function determines the values.

You can add calculated fields to columns or groups. This helps you build richer reports.

Generic functions like now() or 2+5 cannot be added to an empty layout. Add at least one column or group from a data source field first.

Calculated fields do not support these options:

  • Filter

  • Prompt

  • Sort

  • Aggregation

Create a calculated field

1

Open Calculated Fields

  1. Open the report where you want the calculated field.

  2. Select the Data tab.

  3. Scroll to the bottom of the tab.

  4. Find Calculated Fields.

Data tab with Calculated Fields
2

Open the Create Calculated Field dialog

Select the plus sign next to Calculated Fields.

The Create Calculated Field dialog appears.

Create Calculated Field dialog
3

Configure the calculated field

Set the values you need:

  • Display Name: Name shown in the report.

  • Category: Function category.

  • Select Fields: Fields you can insert into the formula.

  • Functions: Double-click a function to insert it into Formula.

    • For common formula functions, see the Pentaho Report Designer documentation.

  • Formula: The expression used to calculate values.

  • Data Format: Data type for the field.

    • Numeric

    • Date

    • Other

  • Description: Description of the selected function.

  • Return Type: The function return type.

    • Example: SUM(2, 3) returns an integer type.

    • Example: CONCATENATE("A", "B") returns a string type.

4

Save the calculated field

Select OK.

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

5

(Optional) Edit or use the calculated field

Right-click the calculated field for these actions:

  • Edit: Edit the calculated field formula.

  • Delete: Delete the calculated field.

  • Add To Report: Add the calculated field to columns in the layout.

  • Add To Groups: Add the calculated field to groups in the layout.

Last updated

Was this helpful?