Merge same columns from different tables
Asked by AG:

Hello Atlassian Team

I want to combine the Column '**Weekly Total**' from different tables into one table.

![2022-12-08 14_54_57-Window.png](https://community.atlassian.com/t5/image/serverpage/image-id/229694i7B9FE4B7428A47C5/image-size/large?v=v2&px=999 "2022-12-08 14_54_57-Window.png")

I would like for there to be one table with Weekly Total as separate Columns:

![2022-12-08 14_55_02-Window.png](https://community.atlassian.com/t5/image/serverpage/image-id/229693i0E1AE00FB79BCBCB/image-size/large?v=v2&px=999 "2022-12-08 14_55_02-Window.png")

If possible I would like there to be a way to distinguish if Weekly Total was from Table A or B.

I've been using Table Transformer but not able to get the columns integrated the way I want it to. Anyone have some advice on how to implement this?

Thanks


Answers:
author: Katerina Rudkovskaya [Stiltsoft]
body: Hi [@AG](/t5/user/viewprofilepage/user-id/5097563),

Please follow my example. Here is a screenshot of your tables in the page edit mode:

![Fri 2-1.png](https://community.atlassian.com/t5/image/serverpage/image-id/229838i554CD5437C5AB077/image-size/large?v=v2&px=999 "Fri 2-1.png")

And here is your SQL query where we look up the two tables by the unique key column and rename other columns to distinguish if they are coming from the first or second table:  
SELECT T1.'Key Field',  
T1.'Total' AS 'Total from T1',  
T2.'Total' AS 'Total from T2'  
FROM T1 LEFT JOIN T2 ON T1.'Key Field' = T2.'Key Field'

![Fri 2-2.png](https://community.atlassian.com/t5/image/serverpage/image-id/229839i8DECDCA7FE24848D/image-size/large?v=v2&px=999 "Fri 2-2.png")  
Hope it helps your case.

comments: author: AG
body: Thanks Katerina

I am close, but it is showing the table as below, do you know why?

AG

![2022-12-12 14_36_41-Copy of Akash Gondalia - GMSL - Confluence ? Mozilla Firefox.png](https://community.atlassian.com/t5/image/serverpage/image-id/230170i60B1B462F218A4C3/image-size/large?v=v2&px=999 "2022-12-12 14_36_41-Copy of Akash Gondalia - GMSL - Confluence ? Mozilla Firefox.png")


author: Katerina Rudkovskaya [Stiltsoft]
body: Hi [@AG](/t5/user/viewprofilepage/user-id/5097563),  

Not sure as for now, but it looks like smth is messed up with table headers.   

As you can see on my screenshot, my tables have header rows: grey background is nor just color but real header row created by Confluence itself.  

Your tables (I use the very first screenshot for reference here) have gray background both for the first row, for the first and last columns. Please check that the first row is a real header row and the first, last columns are not header columns (that it is just grey backgriound and bold text).   

If it doesn't help you, please check the version of the app and update it to the latest one if needed.


author: Patrick Vanhoof
body: Are you using the Table Filter \& Charts add-on from [@Stiltsoft support](/t5/user/viewprofilepage/user-id/5062270) ?

comments: author: AG
body: Hi Patrick

Yes I believe I am, the **Weekly Total** Column is derived using the Table Filter Macro and I am trying to combine the **Weekly Total**columns from different tables using the Table Transformer macro

Thanks

AG


Tags: confluence-server

filter

server

sql

table

table-filter

table-filter-and-charts

table-transformer

transformer