---
title: "Adding a Calculated Column to a Report Table"
canonical: "https://docs.rubiconwater.com/space/RptNC/1979679650/Adding%20a%20Calculated%20Column%20to%20a%20Report%20Table"
format: markdown
---
> Macro (toc)

Add custom columns to report tables and use data from other columns in your calculations.

# Creating the Column

**Step 1**

Bind your data and create table columns.

**Step 2**

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.

**Step 3**

In the Table > Columns tab, click **Add** to add a new column. The Add Column screen opens

**Step 4**

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](https://support.rubiconwater.com/help/dms/content/topics/modules/reporteditor/pcd_summary_data.htm) 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 |

**Step 5**

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.

- 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.

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.

---