Hi everyone,
I'm working on a PROC REPORT in SAS and need some help with conditional formatting. Specifically, I want to compare two columns, value1 and value2 , and highlight the greater value in red. Below is a simplified version of my dataset and the PROC REPORT code I've tried:
data sample;
input id value1 value2;
datalines;
1 10 15
2 20 5
3 25 30
4 40 35
5 50 50
;
run;
proc report data=sample nowd;
column id value1 value2;
define id / 'ID' order=data;
define value1 / sum 'Value 1' display;
define value2 / sum 'Value 2' display;
compute value1;
if value1 > value2 then do;
call define(_col_, "style", "style={foreground=Red}");
end;
endcomp;
run;
I want Output
... View more