Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Iterative calculation between columns with the previous row

r-alrahmani
6 - Meteoroid

Hello, 

 

Please see the sheet attached showing the available input (includes both Portfolio input file and Text Input for 5-year projection) as well as the expected output table.

 

Basically, I need to add a column called Closing Portfolio, which is equal to the Opening Portfolio - Repay amount. I need to repeat this for each Fac ID for a 5-year projection. So for the next year, the Opening Portfolio would be equal to the Closing Portfolio of the previous year. 

 

I tried resolving this issue using the Multi-Row Formula tool. Unfortunately I am not getting the right results

 

Appreciate any help.

 

 

1 REPLY 1
fmvizcaino
17 - Castor
17 - Castor

Hi @r-alrahmani ,

 

I'm using a transpose + join to model the dataset prior to multi-row and then doing the calculation as you describe it.

fmvizcaino_0-1590746322357.png

 

The multi-row function is written as follows:

IF isnull([Row-1:Portfolio])
then [Portfolio]
else [Row-1:Portfolio]-[Row-1:Value]
endif

 

So if we are in the first line, we will keep the portfolio amount and for all the next rows within the same FacID, we calculate the previous row and replace the value in the current portfolio amount cell.

 

Best,

Fernando V.

 

Labels