Creating a running total down columns with table calculations
Stay organized with collections
Save and categorize content based on your preferences.
As an alternative to the methods described on this page, when you have the appropriate permissions to create table calculations, you can use shortcut calculations. Shortcut calculations let you perform common calculations on numeric fields that are in an Explore's data table without the need to use Looker functions and operators.
Table calculations let you create ad hoc metrics and perform calculations on the data that is returned by an Explore query. This is convenient for calculating metrics like running totals.
This page shows you how to calculate a running total down columns in an Explore's Data table. You can also create a running total across rows using table calculations, which you can read more about in the Aggregating across rows (row totals) in table calculations Best Practices page.
Using the running_total() function
To create a running total down a column using table calculations, you can use the running_total()
function, which returns the running total of the values in a specified column.
For example, to create a running total of the column Inventory Items Count in the following Explore Data table that shows Inventory Items Count grouped by Inventory Items Created Date, you can create this table calculation:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-22 UTC."],[],[],null,["# Creating a running total down columns with table calculations\n\n\u003e As an alternative to the methods described on this page, when you have the appropriate [permissions](/looker/docs/admin-panel-users-roles#create_table_calculations) to create table calculations, you can use [shortcut calculations](/looker/docs/table-calculations#quick_calculations). Shortcut calculations let you perform common calculations on numeric fields that are in an Explore's data table without the need to use Looker [functions and operators](/looker/docs/functions-and-operators).\n\n\n[Table calculations](/looker/docs/table-calculations) let you create ad hoc metrics and perform calculations on the data that is returned by an Explore query. This is convenient for calculating metrics like running totals.\n\n\nThis page shows you how to calculate a running total down columns in an Explore's **Data** table. You can also create a running total across rows using table calculations, which you can read more about in the [Aggregating across rows (row totals) in table calculations](/looker/docs/best-practices/how-to-aggregate-values-across-rows) Best Practices page.\n\nUsing the `running_total()` function\n------------------------------------\n\n\nTo create a running total down a column using table calculations, you can use the [`running_total()`](/looker/docs/functions-and-operators#functions_for_table_calculations_only)\nfunction, which returns the running total of the values in a specified column.\n\n\nFor example, to create a running total of the column **Inventory Items Count** in the following Explore **Data** table that shows **Inventory Items Count** grouped by **Inventory Items Created Date**, you can create this table calculation: \n\n```\nrunning_total(${inventory_items.count})\n```\n\n\nThis expression yields the following results:"]]