BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
valentina71
Fluorite | Level 6

Hi everybody, i'm facing with a little sas-detail, but probably can solve me a lot of problems...
I'd like to focus my datas, outcoming from my proc tabulate, in some particular conditions (example: differences >10% and so on), but I would like to focus (for example in red) not from the background but from the data.


example: 8% in white, 18% in red (the number and the % character)...


Thank you if'll you kindly help / light me.

valentina from Italy.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Then just change the style call from background to foreground.

So from this:

style={background=pink}

To:

style={foreground=pink}

View solution in original post

8 REPLIES 8
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Output the proc tabulate output to  a dataset, then apply standar traffic lighting in a proc report:

https://communities.sas.com/t5/SAS-Procedures/Traffic-Lighting-with-Proc-Tabulate/td-p/83374

valentina71
Fluorite | Level 6

I'm sorry but I read the post you tell me before to write mine...

it's not helpful, the traffic light is in the background non in the data.

 

thank you, valentina

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Then just change the style call from background to foreground.

So from this:

style={background=pink}

To:

style={foreground=pink}

valentina71
Fluorite | Level 6

thank u!!! it was simple!!!!

in italy we say: I lost myself in a glass of water ( as: It was all a storm in a teacup).

valentina

Criptic
Lapis Lazuli | Level 10

You can try the following code snippet on your example - for more information look at this SAS note http://support.sas.com/kb/23/353.html

   proc report data=sashelp.class nowd;
     column name age sex height weight;
     define name / display;
     define age / order;
     define sex / order;
     define height / sum;
     define weight / sum;
     compute age;
       count+1;
       if count=5 then
          call define(_row_,"style","style={background=red}");
     endcomp;
   run;

 

valentina71
Fluorite | Level 6

this is not a proc tabulate.

ballardw
Super User

And an example using the value of a statistic to change text color.

proc format library=work;
value colorpct
0 - 55 = 'blue'
55<-75 = 'green'
75<-high= 'red';
run;

proc tabulate data=sashelp.class;
   class age;
   class sex;
   table age,
         sex*rowpctn*[style={foreground=colorpct.}];
run;

valentina71
Fluorite | Level 6
thank youuuuuuu!!!

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 8 replies
  • 2441 views
  • 1 like
  • 4 in conversation