Hi, relatively new SAS user here. Any help is greatly appreciated! I need a table with the number of occurrences in each month by 2 criteria (TP and Elevated). So for the following example, I need a table with the # of TP=1 and Elevated=1 occurring in January. example data ID DOV Elevated TP 1 01JAN2017 1 1 2 05JAN2017 0 2 3 07JAN2017 1 3 4 01MAR2017 0 1 5 09MAR2017 1 1 I am able to calculate number of occurrences in each month by TP using: proc sql; CREATE TABLE screen_mth_detail as SELECT distinct(TP), COUNT(distinct ID)AS TP_Count, SUM (DOC between '01AUG2017'd AND '31AUG2017'd)AS AUG17_Count, SUM (DOC between '01SEP2017'd AND '30SEP2017'd)AS SEP17_Count, SUM (DOC between '01OCT2017'd AND '31OCT2017'd)AS OCT17_Count, SUM (DOC between '01NOV2017'd AND '30NOV2017'd)AS NOV17_Count, SUM (DOC between '01DEC2017'd AND '31DEC2017'd)AS DEC17_Count FROM epds1 Group BY TP; run; How can I calculate the same but for only the cases in which Elevated=1?
... View more