<?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: Tabulate cross variables, change cell color based on value in Excel in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Tabulate-cross-variables-change-cell-color-based-on-value-in/m-p/138025#M11081</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks. I understand that it is traffic lighting. But I am not sure how to change the cell color based on the crossed variables. That is my issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Dec 2014 15:59:54 GMT</pubDate>
    <dc:creator>jprosenbaum8908</dc:creator>
    <dc:date>2014-12-10T15:59:54Z</dc:date>
    <item>
      <title>Tabulate cross variables, change cell color based on value in Excel</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Tabulate-cross-variables-change-cell-color-based-on-value-in/m-p/138022#M11078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using proc tabulate to cross variables then outputting to an excel sheet using ods tagset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I am using a dataset that has a zipcode with some of those zipcodes having a leading zero. When I output to excel using ods tagset, it chops off the zero. &lt;/P&gt;&lt;P&gt;I also want to change the color of the cell based on the value of the cell. I want the cell to have a color if there is no missing value or greater than zero.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a sample set of my data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;input Areacode Deliverygrp $ weeknumdeliv;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;01033 H1 02&lt;/P&gt;&lt;P&gt;01033 H1 02&lt;/P&gt;&lt;P&gt;01033 H1 05&lt;/P&gt;&lt;P&gt;01033 H2 01&lt;/P&gt;&lt;P&gt;01033 H2 01&lt;/P&gt;&lt;P&gt;01033 H2 30&lt;/P&gt;&lt;P&gt;02213 H1 44&lt;/P&gt;&lt;P&gt;02213 H1 35&lt;/P&gt;&lt;P&gt;02213 H1 35&lt;/P&gt;&lt;P&gt;02213 H1 35&lt;/P&gt;&lt;P&gt;10033 H1 04&lt;/P&gt;&lt;P&gt;10033 H1 04&lt;/P&gt;&lt;P&gt;10033 H1 06&lt;/P&gt;&lt;P&gt;10033 H2 10&lt;/P&gt;&lt;P&gt;10033 H2 29&lt;/P&gt;&lt;P&gt;21226 H2 15&lt;/P&gt;&lt;P&gt;21226 H2 12&lt;/P&gt;&lt;P&gt;21226 H2 03&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ODS TAGSET.EXCELXP file = 'C:\myfilelocation\testtry3.xls';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc tabulate data = test;&lt;/P&gt;&lt;P&gt;by deliverygrp;&lt;/P&gt;&lt;P&gt;class areacode weeknumdeliv&lt;/P&gt;&lt;P&gt;classlev areacode/style={tagattr ="00000"};&lt;/P&gt;&lt;P&gt;table areacode, weeknumdeliv*N = " ";&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;ODS TAGSETS.EXCLXP CLOSE;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Should I use a proc format procedure for the cell color or is this another tagattr type of redefining the output? Or is this something entirely different?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions would be great. Thanks all!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have attached the excel file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Dec 2014 16:37:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Tabulate-cross-variables-change-cell-color-based-on-value-in/m-p/138022#M11078</guid>
      <dc:creator>jprosenbaum8908</dc:creator>
      <dc:date>2014-12-05T16:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: Tabulate cross variables, change cell color based on value in Excel</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Tabulate-cross-variables-change-cell-color-based-on-value-in/m-p/138023#M11079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What you are doing is called "Traffic Lighting", search this term along with SAS, you will get a ton. For example:&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/resources/papers/proceedings11/290-2011.pdf" title="http://support.sas.com/resources/papers/proceedings11/290-2011.pdf"&gt;http://support.sas.com/resources/papers/proceedings11/290-2011.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Dec 2014 16:53:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Tabulate-cross-variables-change-cell-color-based-on-value-in/m-p/138023#M11079</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2014-12-05T16:53:46Z</dc:date>
    </item>
    <item>
      <title>Re: Tabulate cross variables, change cell color based on value in Excel</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Tabulate-cross-variables-change-cell-color-based-on-value-in/m-p/138024#M11080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To get the leading 0&lt;/P&gt;&lt;P&gt;1) Read the data as Text : input areacode $&lt;/P&gt;&lt;P&gt;2) SORT the data by deliverygrp variable to run as stated&lt;/P&gt;&lt;P&gt;3) Spell TAGSETS.EXCELXP correctly&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; not TAGSET.EXCELXP&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; or&amp;nbsp;&amp;nbsp; TAGSETS.EXCLXP&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Dec 2014 18:03:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Tabulate-cross-variables-change-cell-color-based-on-value-in/m-p/138024#M11080</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-12-05T18:03:46Z</dc:date>
    </item>
    <item>
      <title>Re: Tabulate cross variables, change cell color based on value in Excel</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Tabulate-cross-variables-change-cell-color-based-on-value-in/m-p/138025#M11081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks. I understand that it is traffic lighting. But I am not sure how to change the cell color based on the crossed variables. That is my issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Dec 2014 15:59:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Tabulate-cross-variables-change-cell-color-based-on-value-in/m-p/138025#M11081</guid>
      <dc:creator>jprosenbaum8908</dc:creator>
      <dc:date>2014-12-10T15:59:54Z</dc:date>
    </item>
    <item>
      <title>Re: Tabulate cross variables, change cell color based on value in Excel</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Tabulate-cross-variables-change-cell-color-based-on-value-in/m-p/138026#M11082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Assuming that you fix your syntax errors (misspelled destinations, missing PROC SORT step and missing semi-colons), the syntax would be something like this. I am teaching today, so I don't have full access to SAS and the Internet on the same machine. The solution would be something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;make a user-defined format:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;proc format;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; value &lt;SPAN style="color: #ff00ff; font-size: 14pt;"&gt;bck&lt;/SPAN&gt;&amp;nbsp; . = 'lightyellow'&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 = 'lightblue'&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2 = 'lightgreen'&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3-high = 'lavender';&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;adjust your TABLE statement:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;table areacode, &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; weeknumdeliv*N=" "&lt;SPAN style="color: #ff00ff; font-size: 14pt;"&gt;*{s={background=bck.}}&lt;/SPAN&gt;;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Dec 2014 15:59:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Tabulate-cross-variables-change-cell-color-based-on-value-in/m-p/138026#M11082</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2014-12-11T15:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: Tabulate cross variables, change cell color based on value in Excel</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Tabulate-cross-variables-change-cell-color-based-on-value-in/m-p/138027#M11083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Cynthia. I had figured it out this morning, doing almost what you did. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Dec 2014 16:38:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Tabulate-cross-variables-change-cell-color-based-on-value-in/m-p/138027#M11083</guid>
      <dc:creator>jprosenbaum8908</dc:creator>
      <dc:date>2014-12-11T16:38:29Z</dc:date>
    </item>
  </channel>
</rss>

