Alteryx Designer Desktop Discussions

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

Finding next specific event and appending record

AlexL
7 - Meteor

Hello,

 

I have a large customer data file that logs customer transactions and their dates (I.e buy, sell, other).

Is there to summarize the log to associate the next sell event date after a buy event date if it exists.

*Some customer numbers have sell dates prior to the buy date.

 

I.e. -

Original-

Customer NumberEvent TypeEvent DateBuy DateSell Date
1234Sell1/9/2018 1/9/2018
1234Buy3/5/20183/5/2018 
4567Other6/7/2018  
4567Sell6/7/2018 6/7/2018
4567Buy6/19/20186/19/2018 
4567Other6/21/2018  
4567Other6/21/2018  
9871Buy4/25/20184/25/2018 
9871Sell6/12/2018 6/12/2018
9871Other6/20/2018  
8523Other10/2/2018  
8523Buy10/2/201810/2/2018 
8523Sell11/28/2018 11/28/2018
7415Buy1/22/20181/22/2018 
7415Sell2/12/2018 2/12/2018
7415Other2/13/2018  
7415Sell2/14/2018 2/14/2018
9635Buy3/9/20183/9/2018 
9635Sell4/11/2018 4/11/2018
9635Other4/20/2018  
8524Buy4/4/20184/4/2018 
8524Other5/3/2018  
8524Other6/7/2018  
8524Other9/25/2018  
8524Sell11/26/2018 11/26/2018
9999Buy,Sell6/8/20186/8/20186/8/2018
8881Sell1/18/2018 1/18/2018
8881Sell2/28/2018 2/28/2018
8881Sell3/16/2018 3/16/2018
8881Sell4/10/2018 4/10/2018
8881Sell4/30/2018 4/30/2018
8881Sell5/16/2018 5/16/2018
8881Other5/16/2018  
8881Sell5/29/2018 5/29/2018
8881Sell6/27/2018 6/27/2018
8881Other7/9/2018  
8881Buy8/2/20188/2/2018 
8881Sell8/20/2018 8/20/2018
8881Sell9/7/2018 9/7/2018
8881Sell9/24/2018 9/24/2018
8881Sell10/5/2018 10/5/2018
8881Buy,Sell11/6/201811/6/201811/6/2018
8881Sell12/13/2018 12/13/2018


Desired outcome-

Customer NumberEvent TypeEvent DateBuy DateSell Date
9871Buy4/25/20184/25/20186/12/2018
8523Buy10/2/201810/2/201811/28/2018
7415Buy1/22/20181/22/20182/12/2018
9635Buy3/9/20183/9/20184/11/2018
8524Buy4/4/20184/4/201811/26/2018
9999Buy,Sell6/8/20186/8/20186/8/2018
8881Buy8/2/20188/2/20188/20/2018
8881Buy,Sell11/6/201811/6/201811/6/2018
2 REPLIES 2
DavidP
17 - Castor
17 - Castor

Would this work for you?

 

keep.png

AlexL
7 - Meteor

This is perfect! 

Thank you!

-Alex

Labels