- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 11-29-2017 05:15 AM
(2157 views)
Hello, everyone!
I need to find the maximum and minimum values in the lines and highlight them in different colors, how is this best done?
I can not compare two columns in compute function.
proc report data=work.newtemp nowd;
columns total maxtotal Mintotal meantotal min1;
define total / order format=nlnum10.;
compute total;
if total = min1 then call define (_col_,'style','style={foreground=green font_weight=bold font_size=14pt}');
endcomp;
quit;
columns total maxtotal Mintotal meantotal min1;
define total / order format=nlnum10.;
compute total;
if total = min1 then call define (_col_,'style','style={foreground=green font_weight=bold font_size=14pt}');
endcomp;
quit;
Obs TOTAL mintotal maxtotal meantotal min1
2 | 7046 | 5907 | 8421 | 6937.71 | 6937.71 |
3 | 6071 | 5907 | 8421 | 6937.71 | 6071.00 |
4 | 5907 | 5907 | 8421 | 6937.71 | 5907.00 |
5 | 7094 | 5907 | 8421 | 6937.71 | 6937.71 |
6 | 7910 | 5907 | 8421 | 6937.71 | 6937.71 |
7 | 6115 | 5907 | 8421 | 6937.71 | 6115.00 |
4 REPLIES 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
instead of using _col_ to define the color, use _row_ which will color specific cell rather than the whole column
instead of using _col_ to define the color, use _row_ which will color specific cell rather than the whole column
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi, thx for your answer!
It doesn't change color anywhere, if i write:
compute total;
if total = 5907 then call define (_row_,'style','style={foreground=green font_weight=bold font_size=14pt}');
endcomp;
it works, but if I want to compare the columns, nothing happens.
How do I compare the values of the columns line by line in compute step?
Thank you!
It doesn't change color anywhere, if i write:
compute total;
if total = 5907 then call define (_row_,'style','style={foreground=green font_weight=bold font_size=14pt}');
endcomp;
it works, but if I want to compare the columns, nothing happens.
How do I compare the values of the columns line by line in compute step?
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
compute total;
--->
compute min1;
if total = min1 then call define ('total','
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
It works, if "min1" will be before "total" and add define for min1 as display! Thank you!
proc report data=work.norper nowd;
columns min1 total maxtotal Mintotal meantotal ;
define total / display format=nlnum10.;
define min1 / display format=nlnum10.;
compute total;
if total=min1 then call define (_col_,'style','style={foreground=green font_weight=bold font_size=14pt}');
endcomp;
quit;
proc report data=work.norper nowd;
columns min1 total maxtotal Mintotal meantotal ;
define total / display format=nlnum10.;
define min1 / display format=nlnum10.;
compute total;
if total=min1 then call define (_col_,'style','style={foreground=green font_weight=bold font_size=14pt}');
endcomp;
quit;