Insert Running Total Column with Condition

Hi there,

Is there any trick to insert a running total column based on a condition. Something insert running total column of Column X IF Row in Column Y = ABC?

In the built-in ‘insert a running total column’ transform option, there is currently no fields to add a condition. Any workaround?

Thanks in advance.

Hi @KLoic,

While there’s no one step that does exactly this on it’s own, we can accomplish this operation using multiple steps together.

In the below example, we use a “Filter Rows” step to identify rows where you’d like to calculate a running total. The other “Filter Rows” step is filtering for the exact opposite (can duplicate the first filter step and just change the setting from “Keep” to “Remove”). In total, these 2 filter steps should contain all of your rows of data.

You can then use the “Insert running total column” step after the appropriate filter step, then combine the data back together with a “Stack Tables” step. If having the data in the original order is helpful, you can use an “Insert Row Numbers” step before the filtering, as seen in the example. Then, after stacking the tables, we can sort the table by row number.

Here is a snippet of this example that you can plug right into your flow: parabola:cb:22cf86ed01f54ee58298aaaaf85080e5

Let us know if you have any other questions!

oH nice @Adam_R . this could have worked if I didn’t have multiple conditions to filter by. this workaround would require me to create 20+ filter rows steps since I have a large data volume. In my case, I think Im gonna have to do this step in Google Sheet and then import the dataset in Parabola.

Thanks though.