Good evening, I have following transaction data. one transaction (id) can have max 4 listing agents and 4 selling agents. I want to generate a variable named min_date_la1 to illustrate the oldest transaction the listing_1 undertook (as listing_1, listing_2, listing_3 or listing_4). In other words, I want to find the oldest date_sign by comparing the listing_1 within the listing_1 column and with listing_2 column. For example listing agent A involved in total 5 transactions, (ID=1,4,5,7,10), among them, two was being the listing_1 and other three was being the listing_2. I want to compare the date_sign of those five transactions and generate a new variable called min_date_la1 = min(date_sign). In this case the min_date_la1 for id=1 and id=5 both are 2008-05-11 00:00:00. Can anyone help on the code? I really appreciate. Thank you so much obs id listing_1 listing_2 selling_1 selling_2 status date_sign la1_no_la1_5 la1_no_la2_5 1 1 A B C D sold 2012-01-23 00:00:12 1 2 2 2 C . D . sold 2007-05-01 00:01:15 0 0 3 3 E F A C sold 2013-03-05 08:21:05 1 0 4 4 B A . . expired 2011-01-15 05:21:00 0 0 5 5 A C B F sold 2008-05-11 00:00:00 0 0 6 6 E . D . sold 2011-07-15 00:23:15 0 0 7 7 C A A . sold 2012-11-26 00:15:00 1 1 8 8 C . C F sold 2007-12-15 00:17:25 1 0 9 9 F B B C sold 2014-12-01 00:00:00 0 1 10 10 D A . . expired 2011-12-14 00:15:25 0 0
... View more