<?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: How do I apply conditional formatting in Proc Report, to an &amp;quot;analysis&amp;quot; variable? in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-do-I-apply-conditional-formatting-in-Proc-Report-to-an-quot/m-p/638136#M21534</link>
    <description>&lt;P&gt;I suspect that you may have used the wrong value for your format. It may help to show what you tried that "didn't work" as we can explain why not. For example the actual value of 3% is 0.03. So that would be the value to use in a format range.&lt;/P&gt;
&lt;PRE&gt;Proc format library=work;
value threepct
.03 - high ='red'
other
;


proc report data=sashelp.demographics nowd;
     column region (name, (Pop PopAGR));
     define name / across 'name' ORDER=DATA;
     define Pop / analysis SUM 'Pop' missing;
     define PopAGR / analysis SUM 'PopAGR' missing style=[background=threepct.];
     define region / group 'region' missing;

quit;&lt;/PRE&gt;</description>
    <pubDate>Tue, 07 Apr 2020 17:06:01 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2020-04-07T17:06:01Z</dc:date>
    <item>
      <title>How do I apply conditional formatting in Proc Report, to an "analysis" variable?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-do-I-apply-conditional-formatting-in-Proc-Report-to-an-quot/m-p/638127#M21530</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to apply different colours to the background of a variable, based on the value, in a Proc Report.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have recreated an example using sashelp:&amp;nbsp;&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data=sashelp.demographics nowd;
     column region (name, (Pop PopAGR));
     define name / across 'name' ORDER=DATA;
     define Pop / analysis SUM 'Pop' missing;
     define PopAGR / analysis SUM 'PopAGR' missing;
     define region / group 'region' missing;

quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I need to, say, highlight "PopAGR" in red if it's &amp;gt; 3.00%&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;I know "if call define" does not work as I am using the variable as "analysis".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've also tried Proc Format, but I cannot make it work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've looked everywhere but can't find a solution!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #333333; font-family: inherit; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 300; letter-spacing: normal; line-height: 1.7142; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;I am using EG 7.13&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2020 16:13:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-do-I-apply-conditional-formatting-in-Proc-Report-to-an-quot/m-p/638127#M21530</guid>
      <dc:creator>MART1</dc:creator>
      <dc:date>2020-04-07T16:13:39Z</dc:date>
    </item>
    <item>
      <title>Re: How do I apply conditional formatting in Proc Report, to an "analysis" variable?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-do-I-apply-conditional-formatting-in-Proc-Report-to-an-quot/m-p/638135#M21533</link>
      <description>&lt;P&gt;Lots of examples here:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.lexjansen.com/wuss/2006/tutorials/TUT-Carpenter.pdf" target="_blank"&gt;https://www.lexjansen.com/wuss/2006/tutorials/TUT-Carpenter.pdf&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2020 17:08:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-do-I-apply-conditional-formatting-in-Proc-Report-to-an-quot/m-p/638135#M21533</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-04-07T17:08:04Z</dc:date>
    </item>
    <item>
      <title>Re: How do I apply conditional formatting in Proc Report, to an "analysis" variable?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-do-I-apply-conditional-formatting-in-Proc-Report-to-an-quot/m-p/638136#M21534</link>
      <description>&lt;P&gt;I suspect that you may have used the wrong value for your format. It may help to show what you tried that "didn't work" as we can explain why not. For example the actual value of 3% is 0.03. So that would be the value to use in a format range.&lt;/P&gt;
&lt;PRE&gt;Proc format library=work;
value threepct
.03 - high ='red'
other
;


proc report data=sashelp.demographics nowd;
     column region (name, (Pop PopAGR));
     define name / across 'name' ORDER=DATA;
     define Pop / analysis SUM 'Pop' missing;
     define PopAGR / analysis SUM 'PopAGR' missing style=[background=threepct.];
     define region / group 'region' missing;

quit;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Apr 2020 17:06:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-do-I-apply-conditional-formatting-in-Proc-Report-to-an-quot/m-p/638136#M21534</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-04-07T17:06:01Z</dc:date>
    </item>
    <item>
      <title>Re: How do I apply conditional formatting in Proc Report, to an "analysis" variable?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-do-I-apply-conditional-formatting-in-Proc-Report-to-an-quot/m-p/639003#M21631</link>
      <description>that's great many thanks ballardw&lt;BR /&gt;&lt;BR /&gt;I was not applying the "style" syntax correctly&lt;BR /&gt;&lt;BR /&gt;thanks</description>
      <pubDate>Fri, 10 Apr 2020 16:28:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-do-I-apply-conditional-formatting-in-Proc-Report-to-an-quot/m-p/639003#M21631</guid>
      <dc:creator>MART1</dc:creator>
      <dc:date>2020-04-10T16:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: How do I apply conditional formatting in Proc Report, to an "analysis" variable?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-do-I-apply-conditional-formatting-in-Proc-Report-to-an-quot/m-p/639006#M21632</link>
      <description>thanks PaigeMiller&lt;BR /&gt;&lt;BR /&gt;I didn't come across this article when I was looking&lt;BR /&gt;&lt;BR /&gt;thanks</description>
      <pubDate>Fri, 10 Apr 2020 16:30:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-do-I-apply-conditional-formatting-in-Proc-Report-to-an-quot/m-p/639006#M21632</guid>
      <dc:creator>MART1</dc:creator>
      <dc:date>2020-04-10T16:30:02Z</dc:date>
    </item>
  </channel>
</rss>

