Skip to main content
This gem runs in .
Use the RunningTotal gem to calculate running totals for selected numeric columns. You can also configure optional partitioning and row ordering for the calculation. This gem is useful when you want to control how running total calculations are grouped and ordered across your data.

Prerequisites

  • Add prophecy_basics package version 1.0.11 or higher to your project.

Parameters

Order rows for calculation

Use Order By Columns to select the columns used to order rows for the calculation. Use Sort strategy to choose one of the following options:
  • ascending nulls first
  • ascending nulls last
  • descending nulls first
  • descending nulls last

Example

Let’s say you have the following dataset.
If you select Value in Columns for running total, the gem calculates a cumulative total across the rows.

Result