Cast your vote for the official 2025 Inspire Pin! Designs were submitted by fellow Community members and reflect the creativity and passion of Alteryx users across the globe. Vote now!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Sum all values until the column is greater than 0

Reggie1995
8 - Asteroid

Alright Crew - Here is the scenario.

 

I have this list of data.  When the column 7D5B contains a zero, I need to sum the values on the left. So in the case of the image below, since there is a zero in rows 9-12, then I need to add the values in time diff together.  I then need to do the same again for row 17, 21 and so on.  Each time it list zero, I sum the rows together until that value is no longer zero.  Thoughts here?

 

Reggie1995_0-1610652094149.png

 

4 REPLIES 4
Reggie1995
8 - Asteroid

I don't think I can group by here because I don't want to sum all instances of zero into 1.  Rather, each group of zeroes that are consecutive need to be grouped together.

AngelosPachis
16 - Nebula

Hi @Reggie1995 ,

 

If you want to group consecutive instances of zeroes together, then what about using a multi-row formula tool?

 

AngelosPachis_0-1610653556694.png

 

 

 

Is that the expected output?

 

Cheers,

 

Angelos

Reggie1995
8 - Asteroid

Almost - But I wouldn't want the values in prior.  So I would want the prior to be null and just the 585 number as the only value.  I just care about the final sum if that makes sense.

AngelosPachis
16 - Nebula

@Reggie1995  

 

Like this?

 

AngelosPachis_0-1610655109837.png

 

Another multi-row formula tool was needed, which essentially will null a certain record from the Count field, if the next one in that column is not originally null... if that makes any sense

 

Labels
Top Solution Authors