I have some data, I want reshape long to wide, but with lag; have like this ; want the first var is Turnover, second is month, jour is day in the month, an is year, ident_num is the id of ship( there are 16ships), ident_temp(1 is the first day record the obs,2 is the second,) semaine_num (1 is monday, 2 is Tuesday, There si no Sunday, only Monday to Saturday data).
... View more
sorry for the mistake, it is 250, not 610, and i have do the same as you do , but it doesn't work ,because, if the 6th month have overed 250, then the 7th will also over 250, then all the first_month will be 12.
... View more
I have data about the working time in12 months of 1000 workers, id m1 m2 m3 m4 m5 m6 m7 m8 m9 m10 m11 m12; 1 30 50............................................................30 2 ......................................................................... . . 1000.................................................................... I want to get the first month that total working time over 250, if after 6 month , the first worker have 610 hours ,then the first monthis 6 I need to create a new variable(First_month) for this value.I have tried retain and do until ,but always have problem. do you give me some help, thanks very much!
... View more