---
title: "Manage calculated columns with Advanced Table Viewer macro"
canonical: "https://support.appfire.com/space/TBL/3643965558/Manage%20calculated%20columns%20with%20Advanced%20Table%20Viewer%20macro"
format: markdown
---
> Macro (aura-html)

The Advanced Table Viewer macro enables you to create custom calculated columns using values from other columns. 

- You can configure the calculated columns in the macro setup mode.
- The macro displays the calculated columns in Confluence page edit and view mode.

## Manage calculated columns

> Macro (refined-tabs)
> 
> > Macro (refined-tab)
> 
> > 📝 You need edit permissions to access the setup mode.
> 
> - To add a calculated column, edit the macro to open setup mode. Refer to [Set up the Advanced Table Viewer macro features](https://appfire.atlassian.net/wiki/spaces/TBL/pages/1765147138).
> - Click **Manage** **columns **(). The **Manage columns** feature configuration panel appears on the right side of the screen.
> - To add a new calculated column, either click **Add calculated column** under **Calculated columns**, or click **+** at the end of the column headers in the left panel.
> 
> - The *Add calculated column* dialog opens. It lets you derive new column data from existing column values on a row-by-row basis.
>   - **Column name**: Enter the name for the new calculated column.
>   - To perform calculations, you can use either **Builder** or **Formula** mode.
>     - To use Builder, refer to the **Builder** section on this page.
>     - To use Formula, refer to the **Formula** section on this page.
> 
> 
> ## **Builder**
> 
> - The **Builder** tab provides a user-friendly interface to configure simple mathematical operations without writing custom syntax. For more information, refer to **Supported formulas** section on this page.
>   - **Operation:** Select the mathematical function from the dropdown, such as Sum, Minus, Multiply, or Divide, to execute across your chosen columns.
>   - **Columns to calculate**: The columns dropdown displays only the numeric columns from the table.
>     - Choose columns from the dropdown selectors to include in the calculation. As you select a column, the next dropdown selector shows the remaining numeric columns.
>     - For example, to calculate the *Total cost*, choose **Operation** as *Sum and ***Columns to calculate** as *Budget Allocated (USD)* and Contingency Budget (USD).
>     - To add an additional column in the **Sum** operation, click **Add column**.
>     - The builder adds another column dropdown selector. Select the required column, for example, *Overhead Cost (USD)*.
>   - As you choose the operation and select columns, the builder displays the saved formula and a preview of three table rows with the chosen columns and the new calculated column.
>   - In the preview, the macro displays the new calculated column with a blue highlight and the prefix *fx.*
>   - To add the configured column to the table, click **Save**.
> 
> > 📝 - Click the delete ( )** **icon next to a column name to remove it from the calculation.
> > 📝 - To include additional columns in the operation, click **Add column**. If all columns have been selected for the operation, then you cannot add more columns and the **Add column** button is disabled.
> > 📝 - The macro displays an error message if you try to save the calculated column with a column name that already exists or without selecting columns to calculate.
> 
> - The macro setup mode displays the new calculated column in the left panel.
> - You can manage the calculated columns in the right panel. To edit and delete the calculated columns, refer to the **Edit or delete calculated columns **section on the page.
> - Click **Save** and publish the changes. Both the page edit and view modes display the table with the newly added calculated column without the *fx* prefix.
> 
> 
> ## **Formula**
> 
> The **Formula** tab lets you write custom formulas using a formula editor. You can write simple or conditional formulas, similar to spreadsheet-like expressions. For more information, refer to the **Supported formulas** section on this page.
> 
> ![ATV_Formula tab.png](media://e5164fc4-2433-4cc5-8772-23024ff6e6cf)
> 
> - **Enter formula**: Enter the formula to calculate using values from the table columns. Type '[' and the macro displays the list of column names. You can reference any source column type.
>   - Type the formula using operators (such as +, -, *, /, or conditional functions) and insert columns by typing `[` to select them from the list.
>   - The macro displays a preview of three table rows with the chosen columns and the new calculated column.
>   - In the preview, the macro displays the new calculated column with a blue highlight and the prefix *fx.*
>   - For example, the formula checks for **Budget risk** and returns *True* or *False* values for the Budget risk column.
> 
> > 📝 The macro displays an error message if you try to save the calculated column with a column name that already exists or if the syntax is invalid.
> 
>   - To add the configured column to the table, click **Save**.
>   - The macro setup mode displays the new calculated column in the left panel.
>   - You can manage the calculated columns in the right panel. To edit and delete the calculated columns, refer to the **Edit or delete calculated columns** section on the page.
> 
> ![ATV_Formula_column in setup mode.png](media://6849d072-5070-4768-bbc9-324d9d89917a)
> 
> - Click **Save** and publish the changes. Both the page edit and view modes display the table with the newly added calculated column without the *fx* prefix.
> 
> ![ATV_Formula_Page view.png](media://4d227200-2993-47d4-a11f-e5fc3ad8be9f)
> 
> 
> > Macro (refined-tab)
> 
> After you create a calculated column, you can manage it under **Manage columns**.
> 
> The **Calculated columns** section displays the list of created calculated columns. You can edit or delete the calculated column.
> 
> **Edit calculated column**
> 
> - To edit a calculated column, click **Edit**.
> 
> > 📝 - After you add a new calculated column, you can also edit it from the **Edit column** option in the column header.
> 
> - The *Edit calculated column* dialog opens. You can make the required changes and save the calculated column. The configuration remains similar to adding a calculated column. For more information, refer to the **Add calculated column** section.
> 
> **Delete calculated column**
> 
> - To delete a calculated column, click **Delete,** and the column is removed from the list. To apply the change, click **Save**.
> 
> > Macro (refined-tab)
> 
> The Builder tab supports simple, single-operation math on numeric columns with no syntax to write. The Formula tab supports full spreadsheet-like expressions — operators, functions, conditionals, and any source column type.
> 
> ## Operators and functions
> 
> | **Capability** | **Builder tab** | **Formula tab** |
> | --- | --- | --- |
> | **Column references** | Numeric source columns only (`[Column Name]`) | Any source column by name (`[Column Name]`) |
> | **Sum (**`+`**)** | Yes, supports 3+ columns | Yes |
> | **Minus (**`-`**)** | Yes, 2 columns only | Yes |
> | **Multiply (**`*`**)** | Yes, supports 3+ columns | Yes |
> | **Divide (**`/`**)** | Yes, 2 columns only | Yes |
> | **Mixed operators in one expression** | No — one operator per calculated column | Yes, with standard precedence (`[A] + [B] * [C]`) |
> | **Parentheses** | No | Yes (`([A] + [B]) * [C]`) |
> | **Numeric / string / boolean literals** | No | Yes (`100`, `10.5`)<br>Yes (`"Done"`, `'Open'`)<br>Yes (`TRUE`, `FALSE`) |
> | **Comparisons** (`>`, `<`, `>=`, `<=`, `=`, `<>`) | No | Yes |
> | **Row-wise functions** — `SUM()`, `AVERAGE()`, `MIN()`, `MAX()`, `ABS()`, `ROUND()`, `IF()` | No | Yes, evaluated across the arguments in the current row |
> | **Unary minus** | No | Yes (`-[A] + [B]`) |
> | `SUMIF`** / **`COUNTIF`** / **`AVERAGEIF` | No | No — these are column-level aggregates, not per-row calculations |
> 
> ## Examples
> 
> | Tab | Expression | Result |
> | --- | --- | --- |
> | Builder | SUM: Budget, Spend, Tax →<br>`[Budget] + [Spend] + [Tax]` | Sum |
> | Builder | Minus: Budget, Spend →<br>`[Budget] - [Spend]` | Difference |
> | Builder | Multiply: Qty, Rate →<br>`[Qty] * [Rate]` | Product |
> | Builder | Divide: Total, Count →<br>`[Total] / [Count]` | Quotient |
> | Formula | `[Budget] - [Spend]` | Difference |
> | Formula | `[A] + [B] * [C]` | A + (B × C), respecting operator precedence |
> | Formula | `IF([Status] = "Done", 1, 0)` | Conditional value |
> | Formula | `SUM([A], [B], [C])` | Sum of three cells in the same row |
> | Formula | `ROUND([Total] / [Qty], 2)` | Rounded ratio |