Thanks Paige for your code.
Reeza: What do you want me to explain? I apologize, being an international student, could not meet your standards in explaining things. However, let me try my best.
I have my data under two separate columns:
Column 1 (Month) Column 2 (Customer ID)
201007 x1...xn
. x1...xn
.
.
.
.
.
201310 x1....xn
I want my result in following format:
Column 1 (Month) Column 2 (New ID) Column 3 (ID that exited)
New ID Definition: ID that never appear in last 12 months but appear in current month.
Exit ID Definition: ID that appeared 12 months before but never appeared for next 12 months (including current month).
I hope I explained my problem. If you think I am still unable to explain things, please let me know and I am happy to try as much as I can. Thanks a lot for your help.