Hi,
So this is about counting horizontally from different points for each ID.
Each row represent an individual over 12 years in week increments (52 sometimes 53 weeks in the year).
For every time (week) there is a match with the code 1, 2 or 3 it is to count for that ID, but it must be depending on the startdate if there is one - if there is no startdate it just has to be counting from the first time it meets a 1, 2 or 3. I want to know how many had 78 counts (for 78 weeks - but not for 78 consecutive weeks, gaps are allowed: that is missings in between or other classifications than 1, 2, 3) from when it starts counting.
So variables go from c0101 to c1252 (that's a lot - shown below in short form) ... that means from the year 2001 and the 1st week to the year 2012 and the 52nd week. c0833 would be the 33rd week of year 2008.
I have a million rows.
ID c0101 c0102 c0103 c0104 ... c0833 ... c1252 Startdate
1 1 1 1 1 01JAN01
2 2 2
3 5 5 5 1 1 29MAY08
4 1 1 15MAR04
5
6
7 3 1
8
9 99 99 99 25APR03
10 8 8
11
12 17FEB06
13
14 1 1 1
15
16
I hope someone could give me an idea of what to use. Was thinking of temporary arrays, but there will need to be many of them...
... View more