<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Proc tabulate and class traffic coloring in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-tabulate-and-class-traffic-coloring/m-p/717896#M222080</link>
    <description>&lt;P&gt;Proc TABULATE does not allow you to have individual format per CLASS value.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But you could use Proc REPORT where you do have more control over this. The example below shows how to have different formats for different ACROSS values. The names _c2_, _c3_&amp;nbsp; etc, are the actual column number in the report. The _dummy computed variable is used to apply the different formats to the proper column.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc format;
  value asia
    0 - 15000 = "cxFF0080"
    15000 - 20000 = "cxC83680"
    20000 - high = "cx916D80"
  ;
  value europe
    0 - 36000 = "cx00FF80"
    36000 - 40000 = "cx00C49D"
    40000 - high = "cx009CB0"
  ;
run;

proc report data=sashelp.cars;
  column type origin, invoice _dummy;
  define type / group;
  define origin / across;
  define invoice / analysis mean;
  define _dummy / computed noprint;
  compute _dummy;
    call define("_c2_", "style", "style={background=asia.}");
    call define("_c3_", "style", "style={background=europe.}");
    call define("_c4_", "style", "style={background=blue}");
  endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 09 Feb 2021 13:46:04 GMT</pubDate>
    <dc:creator>BrunoMueller</dc:creator>
    <dc:date>2021-02-09T13:46:04Z</dc:date>
    <item>
      <title>Proc tabulate and class traffic coloring</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-tabulate-and-class-traffic-coloring/m-p/717838#M222062</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to color the class variable using different dynamic rules (traffic light coloring) for each column. I am trying to color VAR2 (class1) using one rule,&amp;nbsp;VAR2 (class3) using another rule...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="traffic.png" style="width: 305px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/54490i58FA3EA2E704C07A/image-size/large?v=v2&amp;amp;px=999" role="button" title="traffic.png" alt="traffic.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this code will color the whole table using the same "traffic" format, but I want to have 3 independent traffic rules.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC FORMAT;
VALUE TRAFFIC
LOW-&amp;lt;30='RED'
30-50='YELLOW'
50&amp;lt; - HIGH= 'GREEN';
RUN;

PROC TABULATE DATE=INPUT_TABLE;
CLASS VAR1;
CLASS VAR2;
TABLE VAR1, VAR2*[STYLE=[BACKROUND=TRAFFIC.];
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2021 11:08:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-tabulate-and-class-traffic-coloring/m-p/717838#M222062</guid>
      <dc:creator>Cannon3006</dc:creator>
      <dc:date>2021-02-09T11:08:04Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate and class traffic coloring</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-tabulate-and-class-traffic-coloring/m-p/717896#M222080</link>
      <description>&lt;P&gt;Proc TABULATE does not allow you to have individual format per CLASS value.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But you could use Proc REPORT where you do have more control over this. The example below shows how to have different formats for different ACROSS values. The names _c2_, _c3_&amp;nbsp; etc, are the actual column number in the report. The _dummy computed variable is used to apply the different formats to the proper column.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc format;
  value asia
    0 - 15000 = "cxFF0080"
    15000 - 20000 = "cxC83680"
    20000 - high = "cx916D80"
  ;
  value europe
    0 - 36000 = "cx00FF80"
    36000 - 40000 = "cx00C49D"
    40000 - high = "cx009CB0"
  ;
run;

proc report data=sashelp.cars;
  column type origin, invoice _dummy;
  define type / group;
  define origin / across;
  define invoice / analysis mean;
  define _dummy / computed noprint;
  compute _dummy;
    call define("_c2_", "style", "style={background=asia.}");
    call define("_c3_", "style", "style={background=europe.}");
    call define("_c4_", "style", "style={background=blue}");
  endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2021 13:46:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-tabulate-and-class-traffic-coloring/m-p/717896#M222080</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2021-02-09T13:46:04Z</dc:date>
    </item>
  </channel>
</rss>

