How can I create an average time to close report in Confluence each month?
Asked by Dave Pasin:

Every month I run 2 filters. One is for all cases created in that month.

The second is for all cases marked as resolved or closed for that calendar month. I need some type of report that will show me the average time it took all of the cases to go from being created to closed or resolved in a given month.


Answers:
author: Katerina Kovriga {Stiltsoft}
body: Hi there,

As this question mentions our [Table Filter and Charts for Confluence](https://marketplace.atlassian.com/apps/27447/table-filter-and-charts-for-confluence?tab=overview&hosting=cloud&utm_source=atl_community) app, we are happy to introduce its new macro -- [Table Spreadsheet](https://docs.stiltsoft.com/display/public/TFAC/How+to+use+Table+Spreadsheet+macro?utm_source=atl_community).

This macro allows you to work with fully functional Excel spreadsheets right in Confluence. You'll be able to use cells' formulas, filters, conditional formatting, etc., create pivot tables and charts from the page view and edit mode.

The Table Spreadsheet macro is available for Cloud and Server/Data Center.

![](https://docs.stiltsoft.com/download/attachments/83100938/Conditional%20formatting.png?version=1&modificationDate=1641987630000&api=v2&effects=border-simple,shadow-kn)


author: Natalie Paramonova [Stiltsoft]
body: Hi Dave,

You can try to use the [Table Transformer](https://docs.stiltsoft.com/display/TableFilter/How+to+use+Table+Transformer+macro?src=contextnavpagetreemode) and [Table Filter](https://docs.stiltsoft.com/display/TableFilter/How+to+use+Table+filter+macro?src=contextnavpagetreemode) macros bundled in the [Table Filter and Charts](https://marketplace.atlassian.com/apps/27447/table-filter-and-charts-for-confluence?hosting=cloud&tab=overview) app.

Table Transformer let you use formulas to output a new column with the number of days spent on resolving a ticket with the help of the SQL query. Table Filter let you calculate the average number of days by outputting the total row.

Here is the example of using these macros:

1. Wrap the Jira Issues macro in the Table Transformer macro.

![2019-04-11_10h30_27.png](https://community.atlassian.com/t5/image/serverpage/image-id/51224i0BC567FF6C83D819/image-dimensions/348x260?v=v2 "2019-04-11_10h30_27.png")

2. Select the SQL query tab and use the following query:

SELECT \*, (('Resolved' - 'Created') / "24h") AS 'Days to close' FROM T\*

![2019-04-11_10h30_48.png](https://community.atlassian.com/t5/image/serverpage/image-id/51227i8049A3468828845A/image-dimensions/578x340?v=v2 "2019-04-11_10h30_48.png")

3. Wrap the Table Transformer macro in the Table Filter macro, select the Table view tab and set the Count totals for columns option.

![2019-04-11_10h31_13.png](https://community.atlassian.com/t5/image/serverpage/image-id/51226i6BEA91242D9F9CF3/image-dimensions/499x352?v=v2 "2019-04-11_10h31_13.png")

![2019-04-11_10h29_27.png](https://community.atlassian.com/t5/image/serverpage/image-id/51228i2019FE6F3AF48F20/image-dimensions/578x356?v=v2 "2019-04-11_10h29_27.png")

4. Save the macro and the page.

![2019-04-11_10h29_59.png](https://community.atlassian.com/t5/image/serverpage/image-id/51225iFAA30EBE27175D30/image-dimensions/547x260?v=v2 "2019-04-11_10h29_59.png")


author: Damien Tan
body: it sounds like you have 2 JIRA filter nicely done to display only the issue tickets that was created and another for resolved on the given month.

if you are looking for a way in Confluence to perform calculation, i'm afraid there isn't one naively as of now.

Perhaps you can look into JIRA's third-party plugin to get the calculation and then report it in Confluence instead.


Tags: jira-software