single cell trafficlight format

Reply
New Contributor
Posts: 4

single cell trafficlight format

I have the following example output table, where 1,2,3,4 are columns for:1)  total sales 2012 2) % of total regions     3)Total sales for 2011  and 4) % for total region

this is created by grouping different regions for the company.   I would like to create a single cell trafficlight with Proc tabulate. that will affect the column 2012 percentage only for the North region as shown below.   (I have the format done, I just need to know how to single specify North and the value of the single % representation).   If possible, I would like to keep using pro Tabulate and not proc Report.

North

  1. 16.220
  2. 37.5%
  3. 71.394
  4. 39.3%

South

  1. 10.797
  2. 24.9%
  3. 37.095
  4. 20.4%

East

  1. 5.938
  2. 13.7%
  3. 27.072
  4. 14.9%

West

  1. 2.490
  2. 5.8%
  3. 11.846
  4. 6.5%

NorthE

  1. 4.001
  2. 9.2%
  3. 18.016
  4. 9.9%

SouthE

  1. 3.857
  2. 8.9%
  3. 16.357
  4. 9.0%

Total

  1. 43.303
  2. 100.0%
  3. 181.780
  4. 100.0%
Super User
Posts: 10,550

Re: single cell trafficlight format

An example of your color background format name and the table statement used to create the table will be helpful to provide specific advise.

BTW, why did you set tag for enterprise guide, gchart and functions when this question doesn't relate to any of those topics?

New Contributor
Posts: 4

Re: single cell trafficlight format

Sorry for the tags.  Newbee with my first three questions to this user community.

The project is all done whithin EG, user generates graphs and charts exported to SAS BI.

Here is my code for the format and the proc tabulate

PROC FORMAT

      ;

               

     PICTURE pctfmt(round)low - < 0 = ' 0009.9%' (prefix='-')

                                  0 - high = ' 0009.9%';

     VALUE trafficfmt  low - <  42.0 ='lightred'

                                 42.0 - 45.0 ='lightorange'

                                 45.0 - 55.0 ='lightgreen'

                                 55.0 - 58.0 ='lightorange'

                                 58.0 - 100 = 'lightred'

   

RUN;

PROC TABULATE

DATA=DATA_SALES

    

     ;

    

     VAR  Actual Previous ;

     CLASS Product / ORDER=UNFORMATTED MISSING;

    

     TABLE

Product={LABEL=''}

ALL={LABEL='Total'  STYLE={Background=lightgray}} *

{STYLE={Background=lightgray}},

Actual={LABEL='Actual'}*F=COMMAX12.*

        Sum={LABEL=''}

Actual={LABEL=' '}  *F=pctfmt.*

           COLPCTSUM<Actual>={LABEL='%'} *F=pctfmt.

Previous={LABEL='Previous'}*f=COMMAX12.*

           Sum={LABEL=' '}

Previous={LABEL=''} *

           COLPCTSum<Previous>={LABEL='%'} *F=pctfmt. 

           

          

/ BOX={LABEL='Office' STYLE={FONT_FACE='Arial' FONT_SIZE=10PT FONT_WEIGHT=BOLD FONT_STYLE=ROMAN FOREGROUND=#FFFFFF BACKGROUND=#333333}}       ;

     ;

RUN;

RUN; QUIT;

TITLE; FOOTNOTE;

Ask a Question
Discussion stats
  • 2 replies
  • 170 views
  • 0 likes
  • 2 in conversation