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.

How to look into previous three row values to Current Row in Alteryx

karthik-1237
5 - Atom

How I can get the following expected output in Alteryx.

 

The scenario is for each account we need to look into IS_DEFAULT Column prior three observations and if 1 is there in any of the previous three observation we need to get result as 1 else 0.

 

 

Group by the account id and if needed we can use order by MONTH_SINCE_DISB and then for each account id we need to look into prior three observations if 1 is there in any of the three observations for that account id then the new column label should be marked as 1 else 0. Iteratively the same logic should be applied for all Account_Id.

 

 

karthik1237_0-1652265447585.png

 

 

3 REPLIES 3
IraWatt
17 - Castor
17 - Castor

Hey @karthik-1237,

Maybe not the most advanced way to do this but you can do something like this:

IraWatt_0-1652266112275.png

Essentially each multi row formula group by ID and grab the row hind each other. If you have any issues make sure to ask :) 

HTH,

Ira

 

Just updated it with your column headers! 

ChrisTX
15 - Aurora

One Multi-Row Formula tool should do the trick.

 

ChrisTX_0-1652268513728.png

 

 

Chris

IraWatt
17 - Castor
17 - Castor

Did not know that was a feature @ChrisTX ! Much better solution :D 

Labels