Hi all, I am currently studying a data on accounts defaulting on their payment, to put it simply, my data has two two fields: Account Number (ACCOUNT) , Default Position (DEFAULT). Default Position is a range of numbers tagged to a date, i.e., 1 as 31December2013, 2 as 31January2014 etc. Apologies if my explanation is rather messy. To put in simpler terms, I want to mark (keep) the default position of each account and track for 10 positions, any default positions in between are ignored (drop), and then upon ending the tracking for 10 positions before, I'll search for the next upcoming default and then marked and the process continues. Example of my data looks like this: ACCOUNT DEFAULT 12345 2 12345 3 12345 15 12345 16 12345 35 23456 1 ... Using the Account Number 12345 above as my example: I would keep the first record (default position 2) as this is the first default, and I will want to track for 10 months up to position 12. I don't want to keep the second record (default position 3) as the distance from the first record default position is still <10 positions. After tracking for 10 months from default position 2, I would look for the next default position, and I want to keep the third record as default position 15 is now >10 positions away from my first default position (default position 2+10). After, I will track for 10 positions from my new default position 15, hence I will not keep my forth record as default position 16 is still <10 positions away from my new record of default (default 15+10). I will track my default for 10 months from default position 15 up to 15+10. Finally, as the previous default tracking ended, I will search for the next upcoming default event and I will keep the fifth record as it is >10 position away from my default 15. I'm trying to do it with a do loop but I can't seem to manage after the first do iteration. Would kindly appreciate assistance on this. Thank you in advance.
... View more