<?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: conditional cell formating in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/conditional-cell-formating/m-p/190544#M9988</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i forgot to say that i use proc print. but if it is complicated for proc print procedure i can use proc report too.&lt;/P&gt;&lt;P&gt;thanks, &lt;/P&gt;&lt;P&gt;emin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Jan 2015 16:13:43 GMT</pubDate>
    <dc:creator>emin_ch</dc:creator>
    <dc:date>2015-01-20T16:13:43Z</dc:date>
    <item>
      <title>conditional cell formating</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/conditional-cell-formating/m-p/190543#M9987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;i got a table like this one:&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="256"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl64" height="40" width="64"&gt;Treatment&lt;/TD&gt;&lt;TD class="xl65" width="64"&gt;Infection1&lt;/TD&gt;&lt;TD class="xl65" width="64"&gt;Infection2&lt;/TD&gt;&lt;TD class="xl65" width="64"&gt;p_value&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" width="64"&gt;A &lt;/TD&gt;&lt;TD align="right" class="xl63" width="64"&gt;3.45&lt;/TD&gt;&lt;TD align="right" class="xl63" width="64"&gt;4.64&lt;/TD&gt;&lt;TD align="right" class="xl63" width="64"&gt;0.683&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" width="64"&gt;B&lt;/TD&gt;&lt;TD align="right" class="xl63" width="64"&gt;4.32&lt;/TD&gt;&lt;TD align="right" class="xl63" width="64"&gt;9.17&lt;/TD&gt;&lt;TD align="right" class="xl63" width="64"&gt;0.04&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" width="64"&gt;C&lt;/TD&gt;&lt;TD align="right" class="xl63" width="64"&gt;2.99&lt;/TD&gt;&lt;TD align="right" class="xl63" width="64"&gt;1.04&lt;/TD&gt;&lt;TD align="right" class="xl63" width="64"&gt;0.02&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;and i would like to apply the backgroundcolor=green for the p_value if infection2 is lower then infection1 AND backgroundcolor=red if infection2 is higher than infection1. do somebody know a simple way to change the cell style based on these two conditions?&lt;/P&gt;&lt;P&gt;kind regards&lt;/P&gt;&lt;P&gt;emin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jan 2015 16:03:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/conditional-cell-formating/m-p/190543#M9987</guid>
      <dc:creator>emin_ch</dc:creator>
      <dc:date>2015-01-20T16:03:10Z</dc:date>
    </item>
    <item>
      <title>Re: conditional cell formating</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/conditional-cell-formating/m-p/190544#M9988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i forgot to say that i use proc print. but if it is complicated for proc print procedure i can use proc report too.&lt;/P&gt;&lt;P&gt;thanks, &lt;/P&gt;&lt;P&gt;emin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jan 2015 16:13:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/conditional-cell-formating/m-p/190544#M9988</guid>
      <dc:creator>emin_ch</dc:creator>
      <dc:date>2015-01-20T16:13:43Z</dc:date>
    </item>
    <item>
      <title>Re: conditional cell formating</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/conditional-cell-formating/m-p/190545#M9989</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are a few papers on changing cell style using proc report and compute blocks.&amp;nbsp; Here is one for starters:&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/resources/papers/proceedings09/273-2009.pdf" title="http://support.sas.com/resources/papers/proceedings09/273-2009.pdf"&gt;http://support.sas.com/resources/papers/proceedings09/273-2009.pdf&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jan 2015 16:14:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/conditional-cell-formating/m-p/190545#M9989</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-01-20T16:14:47Z</dc:date>
    </item>
    <item>
      <title>Re: conditional cell formating</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/conditional-cell-formating/m-p/190546#M9990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks RW9!&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;i have to say that all examples which i read until now changes the cell format based on the value of the cell itself, and &lt;/SPAN&gt;my problem is that the formatting of the cell (p_value) should be based on two conditions: &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;infection2&amp;gt;infection1 and p_value&amp;lt;0.05. can i implement two conditions in the same time in proc template, in proc report or elsewhere? &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jan 2015 16:28:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/conditional-cell-formating/m-p/190546#M9990</guid>
      <dc:creator>emin_ch</dc:creator>
      <dc:date>2015-01-20T16:28:48Z</dc:date>
    </item>
    <item>
      <title>Re: conditional cell formating</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/conditional-cell-formating/m-p/190547#M9991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, you should be able to do that with if statements in the compute, I am not work to test, but something along the lines of:&lt;/P&gt;&lt;P&gt;compute p_value;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if infectiom2 &amp;gt; infection and p_value &amp;lt; 0.05 then call define('p_value','style','style=[background=green]');&lt;/P&gt;&lt;P&gt;endcomp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Worst comes to worst, do the logic in a datastep, have a noprint variable with binary 1 or 0 and use that in your if statement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can reference specific columns/rows/cells also:&lt;/P&gt;&lt;P&gt;&lt;A href="http://www2.sas.com/proceedings/forum2008/224-2008.pdf" title="http://www2.sas.com/proceedings/forum2008/224-2008.pdf"&gt;http://www2.sas.com/proceedings/forum2008/224-2008.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some other papers:&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/rnd/papers/sgf07/sgf2007-report.pdf" title="http://support.sas.com/rnd/papers/sgf07/sgf2007-report.pdf"&gt;http://support.sas.com/rnd/papers/sgf07/sgf2007-report.pdf&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jan 2015 18:03:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/conditional-cell-formating/m-p/190547#M9991</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-01-20T18:03:59Z</dc:date>
    </item>
    <item>
      <title>Re: conditional cell formating</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/conditional-cell-formating/m-p/190548#M9992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This would be better for proc report.&lt;/P&gt;&lt;P&gt;and next time , post such questions at &lt;A _jive_internal="true" data-containerid="2007" data-containertype="14" data-objectid="6" data-objecttype="14" href="https://communities.sas.com/community/support-communities/ods_and_base_reporting" style="color: #0e66ba; background-color: #f0f8fb;"&gt;ODS and Base Reporting&lt;/A&gt; could get a good answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;data have;
input Treatment&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$ Infection1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Infection2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;p_value&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;;
cards;
A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;3.45&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;4.64&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.683
B&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;4.32&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;9.17&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.04
C&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2.99&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1.04&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.02
;
run;
ods listing close;
ods html file='c:\temp\x.html' style=sasweb;
proc report data=have nowd;
columns Treatment&amp;nbsp; Infection1 Infection2 p_value;
define Treatment/display;
define Infection1/display;
define Infection2/display;
compute p_value;
 if Infection1 gt Infection2 then call define(_col_,'style','style={background=green}');
&amp;nbsp; else&amp;nbsp; call define(_col_,'style','style={background=red}');
endcomp;
run;
ods html close;
ods listing;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="x.png" class="jive-image" src="https://communities.sas.com/legacyfs/online/8807_x.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;XIa Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jan 2015 07:12:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/conditional-cell-formating/m-p/190548#M9992</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-01-21T07:12:36Z</dc:date>
    </item>
    <item>
      <title>Re: conditional cell formating</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/conditional-cell-formating/m-p/190549#M9993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you guys!! Everything works as desired.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jan 2015 14:57:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/conditional-cell-formating/m-p/190549#M9993</guid>
      <dc:creator>emin_ch</dc:creator>
      <dc:date>2015-01-26T14:57:47Z</dc:date>
    </item>
  </channel>
</rss>

