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

Alteryx Designer Desktop Discussions

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

Multirow Formula Question

MattR79
8 - Asteroid

I am trying to do a calculation where I take the number of records closed on a particular day and subtract it from the total remaining based on the amount of records closed the day prior. Rather than get the number total closed over time which is what I'm coming up with now I want to get the total that remains.  I cannot figure out how to write a multi-row formula to do that, as I need to get first total remaining number by subtracting the amounts in the first row and then get the following total remaining by subtracting the count on the current row from the total remaining on current row -1.  See below for what I am currently getting vs what is desired and a screenshot of the formula I currently have.  If there is a better way of getting the desired results than to use a multi-row formula I am also open to that.

 

Completed DateCountOriginal CountTotal RemainingDesired Result
[Null]5118-5113
2023-03-151118-6112
2023-07-171118-7111
2023-08-041118-8110
2023-09-112118-10108
2023-09-184118-14104
3 REPLIES 3
ChrisTX
16 - Nebula
16 - Nebula

I used the Multi-Row tool and created a new field [My Result] with this formula:

 

IF IsNull([Completed Date]) THEN [Original Count] - [Count]
ELSE [Row-1:My Result] - [Count]
ENDIF

SPetrie
13 - Pulsar

This should work for you

 

if isnull([Row-1:NewTotal]) then [Original Count] - [Count] else [Row-1:NewTotal] - [Count] endif

 

If the NewTotal is Null, its just original count - count to start it off. After that, you are just subtracting the next count from the NewTotal that was calculated on the previous row.

 

multirow.PNG

MattR79
8 - Asteroid

That worked perfectly for me, thank you for the help.

Labels
Top Solution Authors