mardi 26 juillet 2016
Adding counts based on flags by dates
Could you please advise some direction on how to achieve the below format? I am at lost thinking solution for this problem. basically where flag is 0, sum it up and add it to the very next value where flag is 1 by date
date:
date hrs_clock some_flag some_count
=================================================
6/20/2016 1 0 5
6/20/2016 2 0 6
6/20/2016 3 1 4
6/20/2016 4 1 2
6/20/2016 5 0 4
6/20/2016 6 0 6
6/21/2016 1 0 4
6/21/2016 2 0 3
6/21/2016 3 1 7
6/21/2016 4 1 2
6/21/2016 5 0 5
6/21/2016 6 0 4
6/22/2016 1 0 5
6/22/2016 2 0 5
6/22/2016 3 1 3
6/22/2016 4 1 2
6/22/2016 5 0 8
6/22/2016 6 0 4
Result:
date hrs_clock some_flag some_count
=================================================
6/20/2016 3 1 15
6/20/2016 4 1 2
6/21/2016 3 1 24
6/21/2016 4 1 2
6/22/2016 3 1 22
6/22/2016 4 1 2
6/22/2016 5 0 8
6/22/2016 6 0 4
Inscription à :
Publier les commentaires (Atom)
Aucun commentaire:
Enregistrer un commentaire