How to use multiple queries in a Confluence table

Jitendra Shembekar
Contributor
May 22, 2023

I am trying to solve below problem

- Trying to calculate % of closed defects automatically

(i.e. 70/96 = 73% in the below example)

3.JPG

@Stiltsoft support helped me in getting numbers separated from the text (i.e. separating 70 from '70 issues') and the sql query to perform arithmetic calculation in one of my previous questions.

I am trying to use both of these sql queries in table transformer macro but it is not working.

Can anyone help here.

(@Stiltsoft support - as usual if you may help here)   

Thanks in advance!

1 answer

1 accepted

4 votes
Answer accepted
Katerina Rudkovskaya _Stiltsoft_
Atlassian Partner
May 22, 2023

Hi @Jitendra Shembekar,

Please follow these steps:

Mon 6-1.png

SELECT *,
ROUND('Closed so far'*100/'Total problems', 0) + "%" AS 'Percent'
FROM
(SELECT 'Total problems'->split(" ")->0 AS 'Total problems',
'Closed so far'->split(" ")->0 AS 'Closed so far'
FROM T*)

Mon 6-2.png

Note that here the result table was transposed for better understanding (it is optional, of course):

Mon 6-3.png

Hope this helps your case.

Jitendra Shembekar
Contributor
May 22, 2023

Thank you so much @Katerina Rudkovskaya _Stiltsoft_ for your quick help :)

This works perfectly. You guys are pro!

 

I modified your query little bit to see my table like below.

4.JPG

Like # people like this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events