How to build a table from other tables

Overview

Assume you have a series of status pages that each contain a table of data, such as project milestones. You'd like to have an additional page that pulls the rows from each of the tables on those individual pages and builds a master table that contains all of them in a single table, using something like Excerpt macro. To achieve this follow the steps below.

Prerequisites

  1. Confluence (Server)

  2. SQL-Powered Table Transformer macro for Confluence installed

  3. Documentation: https://v-and-b.atlassian.net/wiki/spaces/PD/pages/763232257

Step-by-Step Instructions

Put each of the tables inside the Excerpt macro container. Note that Standard excerpt macro supports only 1 macro per page, so you’ll need to have one table per page.

On the summary page add the SQL-Powered Table Transformer macro container, then inside the container link all the tables from other pages using the Excerpt Include macro.

Modify the SQL Query in the SQL-Powered Table Transformer macro properties to pull data from all the needed tables. Table names will be TABLE_1, TABLE_2, etc. (according to the order you put them into the SQL-Powered Table Transformer). For example:

SELECT * FROM TABLE_1 UNION SELECT * FROM TABLE_2 UNION SELECT * FROM TABLE_3

Save the macro.

As result your should get a summary table that will contain all data from TABLE_1, TABLE_2 and TABLE_3

If the source tables get updated, the tables generated by the macro will be also updated.