Calculations
Calculations are set up at a section level and are used to generate a value that is not stored in the database, or can be returned using a method. For example, to output a customer's Overdue4 (4 periods overdue) value as a % of their total outstanding balance, you can set up a calculation to do this.
To set up a calculation, select the relevant section and access the Available Fields Palette. Select the Calculations tab and right click to add a new calculation (or to edit, copy or delete an existing one). This opens the Calculation Designer.
The name defaults to Calculation #x using the number of calculations that have already been set up. It is not a requirement to do so, but you should rename the calculation field to something that is more meaningful to you so it is easily recognisable as you continue to develop the report. Calculations default to 2 Decimal places, but you can select a different number.
To create a calculation, drag the relevant property from the Available Fields Palette into the left hand side of the table. You can select a database, parameter, method, other, or calculation field (use this to build on a calculation you have already created to create more complex calculations).
Example
You want to calculate the gross amount for a line item, because this is a value that is not actually stored in the database. To do this, you must add the line lcNetAmount and the lcTaxAmount together. First select lcNetAmount from the database field list and drag it into the calculation line.
Next select the Operator, which in this example will be + (+, -, /, and x are available). You can add a literal value to reflect that the Calculation #1 field always have a value of lcNetAmount + literal value), or drag in another property. In this case, select lcTaxAmount from the list of database fields and drag it into the line.
Now the value of Calculation #1 will be equal to lcNetAmount + lcTaxAmount.
If a calculation requires more than two operands, you can add lines to the calculation, using the first calculation result in the next line.
The Calculation line 1 property is dragged from the Calculations tab in the Available Fields Palette.
Click the arrow icon to delete a calculation line. Only do this if the calculation is not being used in the report (for example, it is in a report section to print, or being used in a query).