I have a certain data which requires me to compare a particular row with all the prior rows in a group and make an indicator accordingly. For e.g ID Issue_date Paid_to_date Product 1 26-Dec-16 26-Dec-16 ARS 1 26-Dec-16 26-Dec-16 ARS 1 26-Dec-16 26-Dec-16 ASS 1 26-Dec-16 26-Dec-16 ASS 1 26-Dec-16 26-Dec-16 ASS 2 28-Dec-16 28-Dec-16 ARS 2 28-Dec-16 28-Dec-16 ARS 2 28-Dec-16 28-Dec-16 ARS This is the dataset. Now i want to compare the second number row of first id with the first row of first id. And i want to compare the third row of first id with the second and first row of first id, fourth row of first id with the first,second, third row of first id. So basically i want to compare a particular row with all the prior rows for a given id. And i want to repeat the steps for all the other ids in the dataset. I tried but i could only compare two subsequent rows and not the ones prior to them. Can you please help.
... View more