Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Subtotal on field change

WVOz1970
5 - Atom

Is there a way to sum a group of items based on when a field changes to something specific and number of rows will vary. Sample data below... I'd like to be able to sum the "Data" numbers whenever the indicator "Flag" changes to "0".  So in the example, I'd subtotal 6+5 for 11, then just 6 for the next subtotal, then 7+6+8+1 for the next subtotal of 22 and so on. Whenever the indicator flag changes to "0", that signifies the next group for subtotaling. The number of rows to subtotal can vary, so it's not something that the Sample tool can account for.

 

Thanks for any input!

 

DataFlag
60
51
60
70
61
82
13
50
61
42
52
60
1 REPLY 1
FinnCharlton
13 - Pulsar

Hi @WVOz1970 , here's how to do this:

FinnCharlton_0-1680706008226.png

Hope this helps!

Labels