<?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 formatting a column based on a threshold value using ODS in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Conditional-formatting-a-column-based-on-a-threshold-value-using/m-p/503092#M771</link>
    <description>I also find one paper (link) which explained usage of binary variable  which quote "In addition, any numeric variable without a usage of ORDER, GROUP or DISPLAY has a default usage of SUM...and that means that the correct reference for VAR4 (and for your NOPRINT items) is variable_name.SUM in the COMPUTE block."&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/SAS-Programming/PROC-REPORT-SAS-log-reporting-dataset-variables-are/td-p/258959" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/PROC-REPORT-SAS-log-reporting-dataset-variables-are/td-p/258959&lt;/A&gt;</description>
    <pubDate>Wed, 10 Oct 2018 14:08:51 GMT</pubDate>
    <dc:creator>SASFREAK</dc:creator>
    <dc:date>2018-10-10T14:08:51Z</dc:date>
    <item>
      <title>Conditional formatting a column based on a threshold value using ODS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Conditional-formatting-a-column-based-on-a-threshold-value-using/m-p/502857#M719</link>
      <description>&lt;P style="margin: 0in; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica',sans-serif; color: #333333;"&gt;I have a task where I need to highlight a cell in an html output if its value falls outside a range (threshold value). The problem is, I have concatenated a value and its %Chg into a single variable for a better representation of the results in an output table. However, I need to highlight the cells based on the threshold values. Since, this new variable is a string (Character) it's not possible (or at least I don't know) to conditional format them on a basis of some numeric value.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in; margin-bottom: .0001pt;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;				diff[i] = comp[i]-base[i];
			 if base[i] &amp;gt; 0 then 
				pct_chg[i] = diff[i]/base[i] *100 ;
			if pct_chg[i]=. then pct_chg[i]=0;
			BASE_C[i] = right(put(diff[i],best.))|| "( " || strip(put(pct_chg[i],best.)) ||" % )"; 
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Difference (%Change) section has columns which I need to format based on a threshold value (see attached). For example, if difference value or PCT value falls outside threshold say 5% then change the cell color to Red. Column "M 201707" under Difference (%Change) is created by using 2 variables,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Where, diff &amp;amp; pct_chg are numeric variables. Is there any way to accomplish this task, may be early in the code or in proc report?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sample_out.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/23915i2F3898EF21601B82/image-size/large?v=v2&amp;amp;px=999" role="button" title="sample_out.PNG" alt="sample_out.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Oct 2018 19:09:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Conditional-formatting-a-column-based-on-a-threshold-value-using/m-p/502857#M719</guid>
      <dc:creator>SASFREAK</dc:creator>
      <dc:date>2018-10-09T19:09:44Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional formatting a column based on a threshold value using ODS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Conditional-formatting-a-column-based-on-a-threshold-value-using/m-p/502860#M720</link>
      <description>Add a variable that is 0/1 if the record needs to be flagged in the data step and then apply the conditional format based on that column. You can use it in PROC REPORT and not display it with the NODISPLAY option.</description>
      <pubDate>Tue, 09 Oct 2018 19:14:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Conditional-formatting-a-column-based-on-a-threshold-value-using/m-p/502860#M720</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-10-09T19:14:15Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional formatting a column based on a threshold value using ODS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Conditional-formatting-a-column-based-on-a-threshold-value-using/m-p/502901#M731</link>
      <description>&lt;P&gt;Hi Reeza,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As you have said, I've created ab binary variable ind = ( pct_chg_lst &amp;lt; &amp;amp;pct_threshold.); where&amp;nbsp;&lt;SPAN&gt;&amp;amp;pct_threshold =5 ( say 5% is my threshold. Now, in my proc report when I'm trying to use this binary variable , I am getting variable uninitialized&amp;nbsp;message.&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;		define BASE_C_LAST / " % Chg #"  	style={cellwidth= 0.60 in};

		COMPUTE BASE_C_LAST;
			if IND= 0 THEN CALL DEFINE("BASE_C_LAST", "style", "STYLE=[BACKGROUND=LAVENDERBLUSH]");
		ENDCOMP; 
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I am trying to change color of variable BASE_C_LAST based on the value of IND.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Oct 2018 20:45:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Conditional-formatting-a-column-based-on-a-threshold-value-using/m-p/502901#M731</guid>
      <dc:creator>SASFREAK</dc:creator>
      <dc:date>2018-10-09T20:45:49Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional formatting a column based on a threshold value using ODS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Conditional-formatting-a-column-based-on-a-threshold-value-using/m-p/502903#M732</link>
      <description>&lt;P&gt;Did you remember to define it in your COLUMN statement? And before the column needed - location matters for COMPUTE variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45322"&gt;@SASFREAK&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi Reeza,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As you have said, I've created ab binary variable ind = ( pct_chg_lst &amp;lt; &amp;amp;pct_threshold.); where&amp;nbsp;&lt;SPAN&gt;&amp;amp;pct_threshold =5 ( say 5% is my threshold. Now, in my proc report when I'm trying to use this binary variable , I am getting variable uninitialized&amp;nbsp;message.&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;		define BASE_C_LAST / " % Chg #"  	style={cellwidth= 0.60 in};

		COMPUTE BASE_C_LAST;
			if IND= 0 THEN CALL DEFINE("BASE_C_LAST", "style", "STYLE=[BACKGROUND=LAVENDERBLUSH]");
		ENDCOMP; 
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I am trying to change color of variable BASE_C_LAST based on the value of IND.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Oct 2018 20:47:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Conditional-formatting-a-column-based-on-a-threshold-value-using/m-p/502903#M732</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-10-09T20:47:43Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional formatting a column based on a threshold value using ODS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Conditional-formatting-a-column-based-on-a-threshold-value-using/m-p/503092#M771</link>
      <description>I also find one paper (link) which explained usage of binary variable  which quote "In addition, any numeric variable without a usage of ORDER, GROUP or DISPLAY has a default usage of SUM...and that means that the correct reference for VAR4 (and for your NOPRINT items) is variable_name.SUM in the COMPUTE block."&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/SAS-Programming/PROC-REPORT-SAS-log-reporting-dataset-variables-are/td-p/258959" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/PROC-REPORT-SAS-log-reporting-dataset-variables-are/td-p/258959&lt;/A&gt;</description>
      <pubDate>Wed, 10 Oct 2018 14:08:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Conditional-formatting-a-column-based-on-a-threshold-value-using/m-p/503092#M771</guid>
      <dc:creator>SASFREAK</dc:creator>
      <dc:date>2018-10-10T14:08:51Z</dc:date>
    </item>
  </channel>
</rss>

