I have a project that produces a sgplot and it works great. However, I'd like to write the code to be able to handle changes in the FISC_YEAR_NBR_LABEL column because over time the dates will auto change based on the day/month/year. The proc report was written with the FISC_YEAR_NBR_LABEL hard coded (see code section). The question is how do I write code to label these with generic variable names then have a method to auto name in the report code after a Proc Transpose? Or other suggestions on how to do this so that I don't have to edit the hard code every year. YoY Comparison FY18 FY18YTD FY19YTD ABC 700 750 532 (colored green) DEF 490 490 380 (colored green) proc report data=WORK.Add_UPdated_Thru nowd nocenter
style(header) = [background=white color=black frame=void]
style(column header) = [background=white color=black frame=void rules=none height=12]
style(report) = [rules=none frame=void cellspacing=15 background=white];
col ('YoY Comparison' Label FY18 FY18YTD FY19YTD);
define Label / ' ';
define FY18 / display;
define FY18YTD / display;
define FY19YTD / display;
compute FY19YTD;
if FY18YTD > FY19YTD then
call define (_col_,"style","style={background=mogy}");
if FY18YTD < FY19YTD then
call define (_col_,"style","style={background=lightred}");
if FY18YTD = FY19YTD then
call define (_col_,"style","style={background=yellow}");
endcomp;
run; Data tables before Proc Transpose and after. Afterwards, the values for the FISC_YEAR_NBR_LABEL become the headers as in the lower chart. Product FISC_YEAR_NBR_LABEL AvgDaily ABC FY18 700 DEF FY18YTD 490 ABC FY18YTD 750 ABC FY19YTD 532 DEF FY19YTD 380 DEF FY18 490 Split Columns to be like this. Product FY18 FY18YTD FY19YTD ABC 700 750 532 DEF 490 490 380
... View more