Adding a Calculated Column to a Report Table
Add custom columns to report tables and use data from other columns in your calculations.
To create a calculated column in a report table:
- Bind your data and create table columns.
- In the Table > Columns tab, check the data types of the columns whose values you will use as operands in your calculated column. If you want to use the values in numerical calculations, set the column data type to a number type as follows:
- Select the column and click Modify
- In the column properties screen, change the Type of the column as required.
- In the Table > Columns tab, click Add to add a new column. The Add Column screen opens
- In the Add Column screen, set the following properties:
Property Description Required? Header
Enter the column header text for this column
No
Width
Enter the column width in pixels
No
Background
Enter the background colour of the column
No
Text
Set the font properties and alignment
No
Type
Set the data type for the column.
Yes Format
Specify the number format
No
Statistics
Specify what type of summary data to display for this column
No
Show summary label
If you are displaying summary data, select this to display a summary data label
No
Data Binding
Enter the calculation that this column will use to generate its data. See below for the calculation syntax.
Yes Hidden Column
Select this checkbox to hide the column
No
- Click OK to save your changes.
Calculation syntax
Referencing other columns
There are two ways to reference other columns in your calculations:
- Use the syntax Cn to refer to the other column by column number.
Example: C3 uses the values from column 3.
Example
C3 uses the values from column 3.
- For bound data, you can also use the syntax #n to refer to the bound data column.
Example: #2 refers to the second bound data column. You can view the properties of the bound data columns to see which data column number refers to which table column. This syntax is preferable for referring to bound columns because it is independent of their positions in the report table.
Example
#2 refers to the second bound data column. You can view the properties of the bound data columns to see which data column number refers to which table column.
This syntax is preferable for referring to bound columns because it is independent of their positions in the report table.
You can mix the two syntax types in the same expression.
Mathematical operators
Note
String operators, such as concatenation are not supported.
- Only basic mathematical operators are supported in calculated column expressions. These are:
Operator Description + Addition
- Subtraction
* Multiplication
/ Division
- Expressions are normally evaluated from left to right, but you can use brackets to control the evaluation order.