I am working on large data set and stuck on the following point.
I would like to calculate time(hours) where group==1. For example, it will be 4 hours for (05/08/2013 22:00 to 05/08/2013 18:00). If this condition meet more than one time within ID, I want to sum this and count how many times this happen.
Code:
input id str20 date group 1 "05/08/2013 14:50" 0 1 "05/08/2013 17:20" 0 1 "05/08/2013 18:00" 1 1 "05/08/2013 20:00" 1 1 "05/08/2013 22:00" 1 1 "05/08/2013 23:00" 0 2 "01/07/2015 05:59" 0 2 "01/07/2015 14:30" 0 2 "01/07/2015 16:00" 1 2 "01/07/2015 19:00" 0 2 "01/07/2015 21:00" 0 2 "02/07/2015 02:00" 1 2 "02/07/2015 06:50" 1 2 "02/07/2015 13:01" 1 2 "02/07/2015 20:00" 0 end
Comment