Table Filter, Charts & Spreadsheets for Confluence Table Transformer Custom Transformation - use cases with advanced SQL queries Executing calculations with SQL Current: Calculating cumulative (running) totals PDF Download PDF Download page Calculating cumulative (running) totals. Current page All pages Calculating cumulative (running) totals Use caseYou have a table (a pivot table) containing a sequence of years and some numeric values.You need to calculate cumulative (running) totals when the value of each next year is added to the sum of the previous ones. SolutionSwitch the page to the edit mode.Insert the Table Transformer macro and paste the table within the macro body.Select the macro and click Edit.Switch to the SQL query tab.Enter the following SQL query: SELECT 'Year', SUM (TT2.'Requests') AS 'Requests' FROM T1 AS TT1 JOIN T1 AS TT2 on TT1.'Year' >= TT2.'Year' GROUP BY TT1.'Year' ORDER BY TT1.'Year' SQL Click Next.Define the table settings and view options if needed.Save the macro and the page. As an alternative you can enable the Cumulative count option in the Pivot Table macro. You can use FORMATWIKI function for the purposes of cell formatting. ×