Can I use Table Transformer to transpose each table before using Table Excerpt Include?
Asked by Pei-ju Hsu:

I saw a way to use **Table Transformer** to transpose the table **after** using **Table Excerpt Include** in this discussion: <https://community.atlassian.com/t5/Confluence-questions/Select-table-rows-in-other-page/qaq-p/1759006>

Is there a way to do the opposite, i.e., transpose each table first then use Table Excerpt Include? Thank you.

For example, the 2 tables in Table Excerpt are:

A \| x1 A \| x2

B \| y1 B \| y2

C \| z1 C \| z2

And I'd like to have the result looks like

A \| B \| C

x1 \| y1 \| z1

x2 \| y2 \| z2

It seems the **Table Excerpt Include** doesn't support merging table by first column but only by first row. If it can support merging table by first column, that can be the solution as well.


Answers:
author: Katerina Kovriga {Stiltsoft}
body: Hi [@Pei-ju Hsu](/t5/user/viewprofilepage/user-id/4513913) ,

You may implement the following steps:

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

Here we have your tables that are collected with the help of the Table Excerpt Include macro:

![Fri 1-2.png](https://community.atlassian.com/t5/image/serverpage/image-id/155823i5D40E4639A7D1E6A/image-size/large?v=v2&px=999 "Fri 1-2.png")The last step is to merge your transposed tables via the Table Transformer macro.

Here we choose the standard Merge preset:

![Fri 1-3.png](https://community.atlassian.com/t5/image/serverpage/image-id/155824i1DD84CEEF640D7E4/image-size/large?v=v2&px=999 "Fri 1-3.png")And here check the Transpose source tables option:

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

And here is your result:

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

Hope this helps your case.

comments: author: Pei-ju Hsu
body: Hi Katerina,

Thank you for the quick response. Yes, this is what I'm looking for. I test it again and it works well. Thank you!

A small feedback -- when I was testing the tool the first time, I was using the case when the first rows of 2 tables are the same (like below). In this case the tool is merging 2 tables by first row but not first column by default.

**A \| x1 A \| x1**

B \| y1 B \| y2

C \| z1 C \| z2


author: Katerina Kovriga {Stiltsoft}
body: It is because the Merge preset is chosen by default for the Table Transformer macro (it comes first in line), so the first row (similar for the two tables) was misinterpreted as a header row.

Thank you for reaching out, I'm glad that everything works now.


author: Pei-ju Hsu
body: Hi Katerina,

Thank you again for your help. I have a follow up question:

I'd like to add "Show page meta data: Page" in Table Excerpt Include macro. How to make it work with Table Transformer like the following?

Page \| A \| B \| C

page1 \| x1 \| y1 \| z1

page2 \| x2 \| y2 \| z2

Thank you,

Pei-ju


author: Katerina Kovriga {Stiltsoft}
body: You won't be able to construct a beautiful table with the page meta data if you need to transpose tables as we performed for your case - you tables will be messed up.

Create source tables horizontally

A \|B \|C

x1\|y1\|z1

Collect them with the Table Excerpt Include macro (check the **"Show as a report table"** option) and [choose to show any meta data you want](https://docs.stiltsoft.com/display/public/TFAC/How+to+use+Table+Excerpt+and+Table+Excerpt+Include+macros#HowtouseTableExcerptandTableExcerptIncludemacros-UsingtheTableExcerptIncludeMacro).

Everything will be shown beautifully and you even won't need the Table Transformer macro at all.


author: eaugust_oxio_io
body: The table looks perfect until I add a page name, which should just appear as a the first column. Is this on the roadmap to be fixed?


author: Katerina Kovriga {Stiltsoft}
body: Hi [@eaugust_oxio_io](/t5/user/viewprofilepage/user-id/2693198) ,

If you mean that the table with meta data coming after the Table Excerpt Include macro has beautifully merged cells (the first table on the screenshot) and after the Table Transformer macro the cells are splitted (the second table on the screenshot), then it's not a bug: the Table Transformer macro is based on the AlaSQL library and refers to every table cell as an entry of a SQL database. So it can't operate with any merged info.

![Wed 13-1.png](https://community.atlassian.com/t5/image/serverpage/image-id/179862i0A47812C90CD88DD/image-size/large?v=v2&px=999 "Wed 13-1.png")

So try not to use the Table Transformer macro on top of the Table Excerpt Include macro if it is not necessary - check the [Show as a report table](https://docs.stiltsoft.com/display/public/TFAC/How+to+use+Table+Excerpt+and+Table+Excerpt+Include+macros#HowtouseTableExcerptandTableExcerptIncludemacros-MergingTables) option in the Table Excerpt Include macro to get a combined report.


author: Stiltsoft support
body: Please check the new **Transpose tables** option in the Table Excerpt Include macro: <https://docs.stiltsoft.com/tfac/cloud/table-excerpt-and-table-excerpt-include-42241623.html#TableExcerptandTableExcerptInclude-TransposingTables>

This option excludes the Table Transformer macro and simplifies the case.


Tags: atl-gruland

confluence-server

excerpt

filter

server

table

table-filter

table-filter-and-charts

table-filter-charts-spreadsheets

table-transformer