Hello all,
I have a table of unique company identifiers (column 1, 'PERMCO') and their corresponding day (column 2,'DATE') and the values for the specific days I want to sum for each month (column 3,'VALUE').
It looks like this and has the size 18828200×3 with around 2000 different company identifiers (PERMCO):
PERMCO DATE VALUE
2584 20030214 4
2584 20030215 2
2584 20030226 2
2584 20030227 1
2584 20030228 1
2584 20030303 2
2584 20030305 5
2584 20030330 4
etc.
I want to sum up VALUE for each month, keep the last day in the month and store it all in a new table/matrix so that it looks like this:
2584 20030228 10
2584 20030330 11
etc.
I couldn't find a solution that works for this purpose. Thanks a lot for your help!
Best Answer