The Calculated Field feature lets you define a new field based on a calculation that includes one or more other fields, literals, functions, or parameters.
You define calculated fields in an unrestricted and uncontrolled way. There are no rules or constraints defined to ensure the syntax and integrity of a calculated field definition. Also, SQL errors occur if fields are used in the definition without being selected in the query.
Calculated fields:
- are only available in the query in which they are defined.
- can result in runtime errors when used in a query with aggregates - unless the calculated field is aggregated, you can not aggregate any other field used in the calculated field.
Some calculated fields are provided in the standard Catalogue and cannot be modified (for example, Age, Initials).
To define a calculated field:
- Go to Enquiries > Query Manager.
- At the Data tab, select the query, and click Move Right to displays the fields in the Query data panel.
- Click Calculated Fields.
- EmpowerHR displays a screen for defining the calculated field, where the Available component panel displays:
- Query Fields
- Functions (plus, minus, multiply, divide)
- Catalogue Fields
- Expand the folders in the Available component panel until you locate the field you want, and then double-click the field to add it to the Expression panel.
- Double-click a function to add it to the Expression panel.
In the following example, we want to see what a salary increase of 5% would cost the organisation.

- Repeat this procedure, starting at step 5, if you want to add more fields and functions to the calculated field.
- At Name, enter a unique name for the field.
- At Type, select the data type for the calculated field.
- If you selected Char (character) as the Type, enter the Length of the field.
- At Display Format, enter a format, if required (optional).
- Click Save.
- EmpowerHR displays Query Manager's Data tab.
- The calculated field appears in the the Query data panel, ready for you to run, or save, the query.

Here's what happens when we run our query, using a calculated field to work out a 5% salary increase.

© 2023 Fusion5. All rights reserved.