The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a summarize table based on columns of a table in confluence?

Deleted user
May 31, 2021

I have a table like this 

table_a.PNG

and I want a small summarized pivot table like shown below based on the above table :

table_b.PNG  

How we can achieve this via confluence ? Is there any macro for this ?

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

3 votes
Answer accepted
Katerina Kovriga _Stiltsoft_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
May 31, 2021

Hi @[deleted] ,

There are no such macros out-of-the-box, you'll need some additional apps to complete your case.

In this thread I suggested using our app - Table Filter and Charts for Confluence (it seems that it was also your question judging by the username).

And here is another bunch of screenshots for you: wrap your table into the Table Transformer macro.

Mon 2-1.png

Mon 2-2.png

SELECT "Summary" AS '',
SUM(IF(T1.'Column A' = "Yes", 1, 0)) AS 'Column A Yes',
SUM(IF(T1.'Column A' = "No", 1, 0)) AS 'Column A No',
SUM(IF(T1.'Column B' = "Yes", 1, 0)) AS 'Column B Yes',
SUM(IF(T1.'Column B' = "No", 1, 0)) AS 'Column B No',
SUM(IF(T1.'Column C' = "Yes", 1, 0)) AS 'Column C Yes',
SUM(IF(T1.'Column C' = "No", 1, 0)) AS 'Column C No'
FROM T1

Mon 2-3.png

Mon 2-4.png

Hope this helps.

Deleted user
May 31, 2021

Excellent answer @Katerina Kovriga _Stiltsoft_ . Thank you very much.

Katerina Kovriga _Stiltsoft_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
May 31, 2021

@[deleted]  And here is another more precise SQL query for your case:

SELECT "Yes" AS 'Count',
SUM(IF(T1.'Column A' = "Yes", 1, 0)) AS 'Column A',
SUM(IF(T1.'Column B' = "Yes", 1, 0)) AS 'Column B',
SUM(IF(T1.'Column C' = "Yes", 1, 0)) AS 'Column C'
FROM T1
UNION ALL CORRESPONDING
SELECT "No" AS 'Count',
SUM(IF(T1.'Column A' = "No", 1, 0)) AS 'Column A',
SUM(IF(T1.'Column B' = "No", 1, 0)) AS 'Column B',
SUM(IF(T1.'Column C' = "No", 1, 0)) AS 'Column C'
FROM T1

Mon 2-5.png

Now you don't need to transpose tables and your result table is neat and easy to read.

Like Deleted user likes this
TAGS
AUG Leaders

Atlassian Community Events