I rarely use proc report but now I need to and I can't figure out how to write this...
I have a report that needs to show number of registrations per month for months that fall within a set timeperiod.
There are some grouping variables and then the months (only the ones where there is at least one registration) as columns and then two summary columns.
The first should calculate the number of registrations (for each group) that falls within the timespan.
The second should calculate the same + the number of registrations that fall outside of the timespan (for each group). The registrations outside the timeperiod don't have a month-value.
My thinking so far:
In order to first sum the columns except for the "outside timespan" I think I need to have "outside timespan" first and summarize all the columns that come after it (as the number of "inside" columns are dynamic).
Then I create another summary column that starts with the "outside" column first and sums up all columns that comes after it (only then the first summary column is also included so I have to deduct that from the total.
Below is some sample code.
With parts of the code commented I get the correct result in the "ouside timespan" column according to the input data. One registration for group 1A-2F-3K and one for group 1B-2J-3R
However when I try to do an across efter the "ouside" column with the "inside" columns below it... The values for the "outside" column disappears and both summary columns show the same value (when the second should show more registrations).
The "outside" column is only in the report for calculating the second summary column... It's shouldn't be visible in the final report...
Any tips on what I'm doing wrong or how to solve it another way would be greatly appreciated.
/Andreas
Can you show what the report is supposed to actually look like given that example data? Complex descriptions really call for a shown result.
So the sums should be like this:
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.