I am not following the message after that.
My code would not take care of duplicated value,since it is monthly (1-12) data.
if you want that change:
i =-11 to 0
-->
i=-12 to -1
My code will give you the exact number as the number of original dataset.
If you have some data like this, mine is different with PG.
id date
1 01jan2010
1 10feb2010
1 01jan2010
1 01jan2010
... View more
Thanks Shmuel.. but actually it must be: retain index_dt; /* after by statement */ I have checked. Please edit your comment, then I will mark it as a solution.
... View more