I am trying to automate a daily report using Proc Report (instead of Excel). The report is a running 8-day report with the dates being the column names. How do I reference the date columns in the COLUMN and DEFINE statements, so that I can format the cell values?
I used TRANSPOSE to get 1 record per BY group.
PROC TRANSPOSE DATA=WORK.DAILYRPT OUT=WORK.DAILYRPT_TRANSPOSE(DROP=_NAME_);
ID MetricDT; /* e.g. 09/02/2024 */
IDLABEL DOW; /* e.g. Mon 09/02 */
VAR MetricValueDaily;
BY BusinessUnitOrderSEQ BusinessUnitNM GroupOrderSEQ MetricGrp LabelOrderSEQ MetricLBL;
RUN;
The dates change every day, so the report run on 9/8 would show 8/31-9/7, and the report run on 9/9 would be from 9/1-9/8. (Report is not run on the weekends)
When I run PROC REPORT w/o any statements, I get this:
Proc report
4