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

Running total on multiple columns using set number of rows

rce
5 - Atom

Hey community!

 

I've tried searching for an answer to this but can't seem to connect the dots (so I apologize if this is relatively simple).

 

Essentially what I have is a table that contains daily sales figures for several categories. The date is the rows while the categories are across the top as column headers. I need to add new columns for each category that adds a running total for the previous 35 days (so the 36th record would be the first entry, and it would populate all the way down). I've added a sample table below.

 

 

datecat Acat Bcat Crunning total - Arunning total - Brunning total - C
1/1/20194510   
1/2/2019371   
1/3/2019166   
1/4/2019566   
1/5/20191023   
1/6/20198610   
1/7/2019314   
1/8/2019172   
1/9/2019576   
1/10/2019939   
1/11/20191037   
1/12/20190107   
1/13/2019236   
1/14/2019469   
1/15/2019284   
1/16/2019283   
1/17/2019178   
1/18/2019990   
1/19/2019163   
1/20/2019033   
1/21/20191710   
1/22/20191078   
1/23/2019410   
1/24/20192510   
1/25/2019786   
1/26/20192103   
1/27/2019143   
1/28/20199010   
1/29/20199610   
1/30/2019528   
1/31/2019993   
2/1/20191035   
2/2/2019538   
2/3/2019700   
2/4/2019763161178191
2/5/2019374164179184
2/6/2019296164179187
2/7/20191041165182187
2/8/20197910170180182
2/9/2019873167187189
2/10/20191023167188182
2/11/20196810174189181
2/12/2019084179190189
2/13/20191098174191187
2/14/2019749175197186
2/15/2019213172198188
2/16/20191101174189184
2/17/2019424173196179
2/18/2019495173192174
2/19/2019616175193175
2/20/2019086179186178
2/21/2019128178187176
2/22/20190108170180184
2/23/2019554169184189
2/24/20191910174186190
2/25/20191076174188190
2/26/2019440174188188
2/27/20193101174191188
2/28/2019591175196179
4 REPLIES 4
BrandonB
Alteryx
Alteryx

I did this with a few multi row formulas. This gets the job done, but I am curious if anyone else has a more elegant solution. See workflow that is attached!

 

Multi Row.png

benakesh
12 - Quasar

Hi @rce ,

I tried with iterative macro . If it helps  please mark this as a  solution .

benakesh_0-1574208622944.png

benakesh_1-1574208648472.png

 

Jonathan-Sherman
15 - Aurora
15 - Aurora

Hi @rce,

 

I've built on @BrandonB and believe it's a more dynamic approach as it will automatically take into account and create running totals for any new columns added.

 

image.png

 

If this solves your issue please mark the answer as correct, if not let me know! I've attached my workflow for you to download if needed.

 

Regards,

Jonathan

rce
5 - Atom

That's perfect Jonathan, thank you. 

Labels