zcavaricci
New Member
- Joined
- Apr 24, 2017
- Messages
- 10
Hello,
I need to count the number occurences where blood sugar was >180 2x in a Day for =>3 consecutive days by patient. I have one table with the following structure:
[TABLE="width: 326"]
<colgroup><col><col><col></colgroup><tbody>[TR]
[TD]Date/Time[/TD]
[TD]Patient ID[/TD]
[TD]Glucose Reading[/TD]
[/TR]
[TR]
[TD]1/28/2017 17:36[/TD]
[TD]A[/TD]
[TD]192[/TD]
[/TR]
[TR]
[TD]1/28/2017 20:12[/TD]
[TD]A[/TD]
[TD]311[/TD]
[/TR]
[TR]
[TD]1/29/2017 9:58[/TD]
[TD]A[/TD]
[TD]214[/TD]
[/TR]
[TR]
[TD]1/29/2017 10:58[/TD]
[TD]A[/TD]
[TD]181[/TD]
[/TR]
[TR]
[TD]1/30/2017 20:45[/TD]
[TD]A[/TD]
[TD]279[/TD]
[/TR]
[TR]
[TD]1/30/2017 21:45[/TD]
[TD]A[/TD]
[TD]181[/TD]
[/TR]
[TR]
[TD]1/31/2017 7:48[/TD]
[TD]A[/TD]
[TD]157[/TD]
[/TR]
[TR]
[TD]1/31/2017 12:33[/TD]
[TD]A[/TD]
[TD]157[/TD]
[/TR]
[TR]
[TD]1/31/2017 17:48[/TD]
[TD]A[/TD]
[TD]167[/TD]
[/TR]
[TR]
[TD]1/28/2017 12:35[/TD]
[TD]B[/TD]
[TD]158[/TD]
[/TR]
[TR]
[TD]1/29/2017 12:09[/TD]
[TD]B[/TD]
[TD]190[/TD]
[/TR]
[TR]
[TD]1/29/2017 17:05[/TD]
[TD]B[/TD]
[TD]211[/TD]
[/TR]
[TR]
[TD]1/30/2017 7:41[/TD]
[TD]B[/TD]
[TD]197[/TD]
[/TR]
[TR]
[TD]1/30/2017 12:05[/TD]
[TD]B[/TD]
[TD]211[/TD]
[/TR]
[TR]
[TD]1/30/2017 17:31[/TD]
[TD]B[/TD]
[TD]231[/TD]
[/TR]
[TR]
[TD]1/31/2017 21:26[/TD]
[TD]B[/TD]
[TD]188[/TD]
[/TR]
[TR]
[TD]1/5/2017 22:05[/TD]
[TD]C[/TD]
[TD]205[/TD]
[/TR]
[TR]
[TD]1/5/2017 23:40[/TD]
[TD]C[/TD]
[TD]216[/TD]
[/TR]
[TR]
[TD]1/6/2017 3:18[/TD]
[TD]C[/TD]
[TD]195[/TD]
[/TR]
[TR]
[TD]1/6/2017 7:54[/TD]
[TD]C[/TD]
[TD]187[/TD]
[/TR]
[TR]
[TD]1/7/2017 12:54[/TD]
[TD]C[/TD]
[TD]210[/TD]
[/TR]
[TR]
[TD]1/7/2017 17:22[/TD]
[TD]C[/TD]
[TD]379[/TD]
[/TR]
[TR]
[TD]1/9/2017 7:37[/TD]
[TD]C[/TD]
[TD]191
[/TD]
[/TR]
</tbody>[/TABLE]
Results Expected:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Patient[/TD]
[TD]# Occurrences[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD]1[/TD]
[/TR]
</tbody>[/TABLE]
I need to count the number occurences where blood sugar was >180 2x in a Day for =>3 consecutive days by patient. I have one table with the following structure:
[TABLE="width: 326"]
<colgroup><col><col><col></colgroup><tbody>[TR]
[TD]Date/Time[/TD]
[TD]Patient ID[/TD]
[TD]Glucose Reading[/TD]
[/TR]
[TR]
[TD]1/28/2017 17:36[/TD]
[TD]A[/TD]
[TD]192[/TD]
[/TR]
[TR]
[TD]1/28/2017 20:12[/TD]
[TD]A[/TD]
[TD]311[/TD]
[/TR]
[TR]
[TD]1/29/2017 9:58[/TD]
[TD]A[/TD]
[TD]214[/TD]
[/TR]
[TR]
[TD]1/29/2017 10:58[/TD]
[TD]A[/TD]
[TD]181[/TD]
[/TR]
[TR]
[TD]1/30/2017 20:45[/TD]
[TD]A[/TD]
[TD]279[/TD]
[/TR]
[TR]
[TD]1/30/2017 21:45[/TD]
[TD]A[/TD]
[TD]181[/TD]
[/TR]
[TR]
[TD]1/31/2017 7:48[/TD]
[TD]A[/TD]
[TD]157[/TD]
[/TR]
[TR]
[TD]1/31/2017 12:33[/TD]
[TD]A[/TD]
[TD]157[/TD]
[/TR]
[TR]
[TD]1/31/2017 17:48[/TD]
[TD]A[/TD]
[TD]167[/TD]
[/TR]
[TR]
[TD]1/28/2017 12:35[/TD]
[TD]B[/TD]
[TD]158[/TD]
[/TR]
[TR]
[TD]1/29/2017 12:09[/TD]
[TD]B[/TD]
[TD]190[/TD]
[/TR]
[TR]
[TD]1/29/2017 17:05[/TD]
[TD]B[/TD]
[TD]211[/TD]
[/TR]
[TR]
[TD]1/30/2017 7:41[/TD]
[TD]B[/TD]
[TD]197[/TD]
[/TR]
[TR]
[TD]1/30/2017 12:05[/TD]
[TD]B[/TD]
[TD]211[/TD]
[/TR]
[TR]
[TD]1/30/2017 17:31[/TD]
[TD]B[/TD]
[TD]231[/TD]
[/TR]
[TR]
[TD]1/31/2017 21:26[/TD]
[TD]B[/TD]
[TD]188[/TD]
[/TR]
[TR]
[TD]1/5/2017 22:05[/TD]
[TD]C[/TD]
[TD]205[/TD]
[/TR]
[TR]
[TD]1/5/2017 23:40[/TD]
[TD]C[/TD]
[TD]216[/TD]
[/TR]
[TR]
[TD]1/6/2017 3:18[/TD]
[TD]C[/TD]
[TD]195[/TD]
[/TR]
[TR]
[TD]1/6/2017 7:54[/TD]
[TD]C[/TD]
[TD]187[/TD]
[/TR]
[TR]
[TD]1/7/2017 12:54[/TD]
[TD]C[/TD]
[TD]210[/TD]
[/TR]
[TR]
[TD]1/7/2017 17:22[/TD]
[TD]C[/TD]
[TD]379[/TD]
[/TR]
[TR]
[TD]1/9/2017 7:37[/TD]
[TD]C[/TD]
[TD]191
[/TD]
[/TR]
</tbody>[/TABLE]
Results Expected:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Patient[/TD]
[TD]# Occurrences[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD]1[/TD]
[/TR]
</tbody>[/TABLE]