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.

  1. Click on:  to go to the Function fields tab.
  2. Click on:  to add a function field.
  3. Enter the Code and Name.
  4. Select Expression as the Kind.
  5. Select the Type of the result of the calculation.
  6. Go to the tab: (Script functions).
  7. Select the script function and drag it to the calculation area.

    At the bottom of the window an explanation of the function is shown.

  8. Go to the tab: Data fields.
  9. 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

  1. Function fields in reports
  2. Add function fields to reports
  3. Add function fields with a calculation to a report
  4. Combine text using an expression
  5. Add a script
  6. Add a text block
  7. Add a constant