Add a function field with a calculation to a report
If you want to perform a calculation on a field, you use an expression. You can use arithmetic operators (such as + - * /) or script functions.
The following components are involved in a calculation:
- Values
In your calculation you can use fields from the data collection and function fields you have added yourself. You can also enter a value for a calculation or use a constant. A constant is a function field that always has the same value.
You can only perform calculations on fields or function fields that have values that are suitable for this purpose, such as numerical or decimal values. For example, if a field contains an alphanumerical value, you first have to use an operator of the 'Type conversion' type to convert it to the correct value type.
- Calculation
You can use arithmetic operators (such as + - * /) or script functions.
- Result
The type of the function field determines whether the result is a numerical or decimal value, a date or a Y/N value. In addition, operators to affect the result are available, for example to set the number of decimals.
To add a function field with a calculation to the report:
In this example you add a function field with a calculation.
- Click on: to go to the Function fields tab.
- Click on: to add a function field.
- Enter the Code and Name.
- Select Expression as the Kind.
- Select the Type of the result of the calculation.
- Go to the tab: (Script functions).
- Select the script function and drag it to the calculation area.
At the bottom of the window an explanation of the function is shown.
- Go to the tab: Data fields.
- Drag the fields to the editing box, between the brackets and separate them by a comma. Instead of data fields you can also enter function fields or a value.
Directly to
|