DATA Step, Macro, Functions and more

coloured data in proc tabulate

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 5
Accepted Solution

coloured data in proc tabulate

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.

 

 


Accepted Solutions
Solution
‎04-13-2017 09:10 AM
Super User
Super User
Posts: 7,392

Re: coloured data in proc tabulate

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


All Replies
Super User
Super User
Posts: 7,392

Re: coloured data in proc tabulate

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

Occasional Contributor
Posts: 5

Re: coloured data in proc tabulate

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

Solution
‎04-13-2017 09:10 AM
Super User
Super User
Posts: 7,392

Re: coloured data in proc tabulate

Then just change the style call from background to foreground.

So from this:

style={background=pink}

To:

style={foreground=pink}

Occasional Contributor
Posts: 5

Re: coloured data in proc tabulate

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

Contributor
Posts: 26

Re: coloured data in proc tabulate

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;

 

Occasional Contributor
Posts: 5

Re: coloured data in proc tabulate

this is not a proc tabulate.

Super User
Posts: 10,483

Re: coloured data in proc tabulate

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;

Occasional Contributor
Posts: 5

coloured data in proc tabulate

thank youuuuuuu!!!
☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

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