This gem runs in .
Prerequisites
- Add
prophecy_basicspackage version 1.0.11 or higher to your project.
Parameters
| Parameter | Description |
|---|---|
| Columns for running total | Select the columns to include in the running total calculation. |
| Partition by (optional) | Optionally select fields to partition the calculation. |
| Order rows for calculation (optional) | Configure how rows are ordered for the calculation. This section includes Order By Columns and Sort strategy. |
| Output column prefix (optional) | Enter a prefix for the output columns. |
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.| Record | Value |
|---|---|
| A | 10 |
| B | 12 |
| C | 4 |
Result
| Record | Value | RunningTotal_Value |
|---|---|---|
| A | 10 | 10 |
| B | 12 | 22 |
| C | 4 | 26 |

