Hi,
I have one big table that I want to display counts of:
I was able to populate Table A with three macros (see screenshot). But this solution is heavy and takes a long time to load as I have many other macros on the page.
Any lightweight solution to look like Table B? Please note, I do not have TRANSWIKI.
Thank you.
HI @Leona ,
Welcome to Atlassian community.
The below thread has some solution for you. It uses table transformer macro.
Try that.
Thanks,
Srinath T
Hi @Leona ,
As @Srinatha T has kindly mentioned, the similar case can be achieved with one Jira Issues macro and one Table Transformer macro.
SELECT *, 'Open'/'All'*100 AS '% of Completion'
FROM (SELECT SUM(IF(T1.'Status' = "To Do", 1, 0)) AS 'Open',
SUM(IF('Status' IN ("To Do", "In Progress", "Done", "Answered"), 1, 0)) AS 'All'
FROM T*)
To get a vertical table instead of the horizontal one go to the "Settings" tab of the Table Transformer macro and check the "Transpose result table" option.
Hope this helps your case.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you both for the quick response. The solution works beautifully.
I would use COUNT in the same way as SUM with the IF statement? When then would COUNT be a better solution than SUM? Thanks again.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
And pay attention to the obtained results:
SELECT SUM(IF(T1.'Status' = "To Do", 1, 0)) AS 'Open' FROM T1
equals to the
SELECT COUNT('Status' = "To Do") AS 'Open' FROM T1 WHERE T1.'Status' = "To Do"
The simple changing of the function's name can lead to incorrect results (your conditions won't be taken into consideration).
You can find more use cases here.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Katerina, which of the two would have a better performance from the two examples you provided? COUNT vs SUM? I am learning lots, thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The performance depends more on the number of issues that are returned by your Jira Issues macro and the number of other macros on top.
Here we have one Table Transformer, so only one SQL query will be applied to the source table. And the SUM function just makes the initial SQL query look more neat and easy-to-read.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.