Knowledge Drop

How to create a cumulative subtract down a column (Subtract Running Totals)

  • 7 May 2021
  • 0 replies
  • 117 views

Last tested: Mar 11, 2021
 

The Problem

 If I want to perform a cumulative subtracting with the current cumulative row value minus the next row value with table calculation?

Solution:

One options is to use the following

sum(offset_list(

if( row() = 1, ${users.average_age},-${users.average_age} )

,

1-row(),

row()

)

)

 

The outcome in the Explore UI will look like this:

Screen Shot 2021-03-11 at 18.46.54.png


As we use so many functions combined here, I would suggest to look them up in our docs here for more context.

 

This content is subject to limited support.                

 

 


0 replies

Be the first to reply!

Reply