- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 08-02-2022 10:34 PM
(660 views)
Hello
Let's say that I have a data set that included summary information by customers grade.
Let's say that there is a macro variable called colorgrade and the task is to color the row with the chosen grade in red color.
What is the way to do it please?
%let colorgrade=10;
Data have;
Input grade nr obligo2205 obligo2204;
Cards:
2 80000 200 220
3 70000 190 210
4 200000 400 370
5 250000 500 480
6 280000 520 510
7 180000 280 320
8 140000 210 215
9 90000 140 130
10 30000 90 92
;
Run;
Let's say that I have a data set that included summary information by customers grade.
Let's say that there is a macro variable called colorgrade and the task is to color the row with the chosen grade in red color.
What is the way to do it please?
%let colorgrade=10;
Data have;
Input grade nr obligo2205 obligo2204;
Cards:
2 80000 200 220
3 70000 190 210
4 200000 400 370
5 250000 500 480
6 280000 520 510
7 180000 280 320
8 140000 210 215
9 90000 140 130
10 30000 90 92
;
Run;
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
It is not possible to change the background colour of a row in a dataset.
Edit: If you want a report, using proc report would be my first choice. There are many papers explaining how to change the background colour conditionally, i am sure you will find something adaptable to your issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
%let colorgrade=10; Data have; Input grade nr obligo2205 obligo2204; Cards; 2 80000 200 220 3 70000 190 210 4 200000 400 370 5 250000 500 480 6 280000 520 510 7 180000 280 320 8 140000 210 215 9 90000 140 130 10 30000 90 92 ; Run; proc report data=have nowd; define grade/display; compute grade; if grade=&colorgrade. then call define(_row_,'style','style={background=red}'); endcomp; run;