Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,369,740
Community Members
 
Community Events
168
Community Groups

How can I sum columns from several different tables?

Hi,

I need to sum columns from several different tables. I have used Table Excerpt and Table Excerpt include already to transfer two of the tables to the page on which I need the final table. Currently I have two tables that look like this but they are inside one 'Table excerpt include' macro if that makes sense.

image.png

But I need to sum these two tables so that I have one table with the sums of goal reached (here: 1 + 5), committed and sum of cases.

 

Could you help me please?

Thanks!

2 answers

1 accepted

4 votes
Answer accepted

Hi @Eva Kröger ,

As I understand your case correctly, you collect these two tables via the Table Excerpt Include macro, tick the "Show as a report table" option...

Wed 6-1.png

... and get one big table where you need to sum values and group your data by the first column.

In my example it will be a table where I have the departments 'DeptId' to be repeated several times with different values.

Thu 8-1.png

Here I have a manually created table wrapped in the Table Transformer macro, but you will need to place your Table Excerpt Include macro inside the Table Transformer macro.

Then you go to the Table Transformer macro and use the following SQL query:

SELECT 'DeptId',
SUM('ManagerId') AS 'ManagerId',
SUM('EmployeeId') AS 'EmployeeId',
SUM('Salary') AS 'Salary'
FROM T* GROUP BY 'DeptId'

And here goes your result report:

Thu 8-2.png

Hope this helps.

1 vote

Thanks so much, that worked well! 

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events