<?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 report- color coding the results with difference in total in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-color-coding-the-results-with-difference-in-total/m-p/721396#M223589</link>
    <description>Cynthia, thank you for your feedback..&lt;BR /&gt;Here is the  data and the code..&lt;BR /&gt;I want to show AL and AR on the report even thought they don't have any data.&lt;BR /&gt;My percentages are messed up. I would like to round to 100% it the total is greater than the biweekly target.  and color code based on the diff or pct.&lt;BR /&gt;red for any thing below 70% and yellow 71% to 89% and green for 90 and above.&lt;BR /&gt;data have;&lt;BR /&gt;  &lt;BR /&gt;  infile datalines;&lt;BR /&gt;  input State $	BiWeekly_target wk : date.	Reached_status ;&lt;BR /&gt;  &lt;BR /&gt;datalines;&lt;BR /&gt;&lt;BR /&gt;AK	15	20FEB2021	12&lt;BR /&gt;AL	11	 	 &lt;BR /&gt;AR	8	 	 &lt;BR /&gt;AZ	12	13FEB2021	8&lt;BR /&gt;CO	10	20FEB2021	9&lt;BR /&gt;CT	11	13FEB2021	11&lt;BR /&gt;DC	16	20FEB2021	12&lt;BR /&gt;DE	9	20FEB2021	9&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;proc report data=have nowd SPLIT='*' ;&lt;BR /&gt;  column  state BiWeekly_target wk, &lt;BR /&gt;         Reached_status ('Total' Reached_status =tot) diff diff_pct;	&lt;BR /&gt;	define state  / group width= 45 " State ";&lt;BR /&gt;	define BiWeekly_target / group width= 15 " Bi-Weekly * Counts";&lt;BR /&gt;    define wk/ across width= 30 order= Internal "week ";&lt;BR /&gt;    define Reached_status / sum width= 30 " ";&lt;BR /&gt;    define tot / sum ' ';&lt;BR /&gt;    define diff  / computed  "  shortage";&lt;BR /&gt;    compute diff;&lt;BR /&gt;    diff=BiWeekly_target -tot;&lt;BR /&gt;    endcomp;&lt;BR /&gt;    define diff_pct  / computed  " %  shortage" format=percent6. width=8;&lt;BR /&gt;    compute diff_pct;&lt;BR /&gt;    diff_pct=(tot/BiWeekly_target)*100;&lt;BR /&gt;   endcomp;&lt;BR /&gt;rbreak after / summarize;&lt;BR /&gt;run;</description>
    <pubDate>Tue, 23 Feb 2021 20:57:37 GMT</pubDate>
    <dc:creator>Stalk</dc:creator>
    <dc:date>2021-02-23T20:57:37Z</dc:date>
    <item>
      <title>Proc report- color coding the results with difference in total</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-color-coding-the-results-with-difference-in-total/m-p/721122#M223442</link>
      <description>&lt;P&gt;Have..&lt;/P&gt;
&lt;TABLE width="382"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="64"&gt;State&lt;/TD&gt;
&lt;TD width="64"&gt;BiWeekly_target&lt;/TD&gt;
&lt;TD width="190"&gt;wk&lt;/TD&gt;
&lt;TD width="64"&gt;Reached_status&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;AK&lt;/TD&gt;
&lt;TD&gt;15&lt;/TD&gt;
&lt;TD&gt;2021-02-14 To 2021-02-20&lt;/TD&gt;
&lt;TD&gt;12&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;AL&lt;/TD&gt;
&lt;TD&gt;11&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;AR&lt;/TD&gt;
&lt;TD&gt;8&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;AZ&lt;/TD&gt;
&lt;TD&gt;12&lt;/TD&gt;
&lt;TD&gt;2021-02-07 To 2021-02-13&lt;/TD&gt;
&lt;TD&gt;8&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;CO&lt;/TD&gt;
&lt;TD&gt;10&lt;/TD&gt;
&lt;TD&gt;2021-02-14 To 2021-02-20&lt;/TD&gt;
&lt;TD&gt;9&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;CT&lt;/TD&gt;
&lt;TD&gt;11&lt;/TD&gt;
&lt;TD&gt;2021-02-14 To 2021-02-20&lt;/TD&gt;
&lt;TD&gt;11&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;DC&lt;/TD&gt;
&lt;TD&gt;16&lt;/TD&gt;
&lt;TD&gt;2021-02-07 To 2021-02-13&lt;/TD&gt;
&lt;TD&gt;12&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;DE&lt;/TD&gt;
&lt;TD&gt;9&lt;/TD&gt;
&lt;TD&gt;2021-02-14 To 2021-02-20&lt;/TD&gt;
&lt;TD&gt;9&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;Want&lt;/P&gt;
&lt;TABLE width="629"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="64"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="94"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD colspan="3" width="343"&gt;week&lt;/TD&gt;
&lt;TD width="64"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="64"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD colspan="2"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;2021-02-07 To 2021-02-13&lt;/TD&gt;
&lt;TD&gt;2021-02-14 To 2021-02-20&lt;/TD&gt;
&lt;TD&gt;Reached_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gt;
&lt;TR&gt;
&lt;TD&gt;DC&lt;/TD&gt;
&lt;TD&gt;16&lt;/TD&gt;
&lt;TD&gt;12&lt;/TD&gt;
&lt;TD&gt;-&lt;/TD&gt;
&lt;TD&gt;12&lt;/TD&gt;
&lt;TD&gt;4&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;DE&lt;/TD&gt;
&lt;TD&gt;9&lt;/TD&gt;
&lt;TD&gt;-&lt;/TD&gt;
&lt;TD&gt;9&lt;/TD&gt;
&lt;TD&gt;9&lt;/TD&gt;
&lt;TD&gt;0&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;So far tried the following..&lt;BR /&gt;ODS excel options(sheet_name=' Counts ' autofilter='all' embedded_titles='yes' embedded_footnotes='yes'&lt;BR /&gt;absolute_column_width='10,45,15,25,25,15' flow = "header, data");&lt;/P&gt;
&lt;P&gt;proc report data=target_stat nowd SPLIT='*' ;*completerows;&lt;BR /&gt;column state BiWeekly_target Category, Reached_status ('Total' Reached_status =tot);;&lt;BR /&gt;&lt;BR /&gt;define state / group width= 45 " Submitter";&lt;BR /&gt;define BiWeekly_target / group width= 45 " BiWeekly * Target";&lt;BR /&gt;define Category/ across width= 30 order= Internal "week ";&lt;BR /&gt;define Reached_status / sum width= 30 " ";&lt;BR /&gt;define tot / sum ' ';&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;Need to achieve..&lt;BR /&gt;1) Show all states irrespective of reached_status For ex: AL &amp;amp; AR- completerows is not working as desired&lt;BR /&gt;2) Add new column in report to show the difference BiWeekly_target- Reached_status&lt;BR /&gt;3) Add another column to show the percent difference.&lt;BR /&gt;4) Color, if difference is zero then target reached so it should be green, If diff greater than 75% then it should be yellow&lt;BR /&gt;otherwise red.&lt;BR /&gt;5) Is it possible to wrap the second row in the report( dates row)?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thank you&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2021 22:59:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-color-coding-the-results-with-difference-in-total/m-p/721122#M223442</guid>
      <dc:creator>Stalk</dc:creator>
      <dc:date>2021-02-22T22:59:36Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report- color coding the results with difference in total</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-color-coding-the-results-with-difference-in-total/m-p/721136#M223446</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/358432"&gt;@Stalk&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Have..&lt;/P&gt;
&lt;TABLE width="382"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="64"&gt;State&lt;/TD&gt;
&lt;TD width="64"&gt;BiWeekly_target&lt;/TD&gt;
&lt;TD width="190"&gt;wk&lt;/TD&gt;
&lt;TD width="64"&gt;Reached_status&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;AK&lt;/TD&gt;
&lt;TD&gt;15&lt;/TD&gt;
&lt;TD&gt;2021-02-14 To 2021-02-20&lt;/TD&gt;
&lt;TD&gt;12&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;AL&lt;/TD&gt;
&lt;TD&gt;11&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;AR&lt;/TD&gt;
&lt;TD&gt;8&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;AZ&lt;/TD&gt;
&lt;TD&gt;12&lt;/TD&gt;
&lt;TD&gt;2021-02-07 To 2021-02-13&lt;/TD&gt;
&lt;TD&gt;8&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;CO&lt;/TD&gt;
&lt;TD&gt;10&lt;/TD&gt;
&lt;TD&gt;2021-02-14 To 2021-02-20&lt;/TD&gt;
&lt;TD&gt;9&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;CT&lt;/TD&gt;
&lt;TD&gt;11&lt;/TD&gt;
&lt;TD&gt;2021-02-14 To 2021-02-20&lt;/TD&gt;
&lt;TD&gt;11&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;DC&lt;/TD&gt;
&lt;TD&gt;16&lt;/TD&gt;
&lt;TD&gt;2021-02-07 To 2021-02-13&lt;/TD&gt;
&lt;TD&gt;12&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;DE&lt;/TD&gt;
&lt;TD&gt;9&lt;/TD&gt;
&lt;TD&gt;2021-02-14 To 2021-02-20&lt;/TD&gt;
&lt;TD&gt;9&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;Want&lt;/P&gt;
&lt;TABLE width="629"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="64"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="94"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD colspan="3" width="343"&gt;week&lt;/TD&gt;
&lt;TD width="64"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="64"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD colspan="2"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;2021-02-07 To 2021-02-13&lt;/TD&gt;
&lt;TD&gt;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;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;DC&lt;/TD&gt;
&lt;TD&gt;16&lt;/TD&gt;
&lt;TD&gt;12&lt;/TD&gt;
&lt;TD&gt;-&lt;/TD&gt;
&lt;TD&gt;12&lt;/TD&gt;
&lt;TD&gt;4&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;DE&lt;/TD&gt;
&lt;TD&gt;9&lt;/TD&gt;
&lt;TD&gt;-&lt;/TD&gt;
&lt;TD&gt;9&lt;/TD&gt;
&lt;TD&gt;9&lt;/TD&gt;
&lt;TD&gt;0&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;So far tried the following..&lt;BR /&gt;ODS excel options(sheet_name=' Counts ' autofilter='all' embedded_titles='yes' embedded_footnotes='yes'&lt;BR /&gt;absolute_column_width='10,45,15,25,25,15' flow = "header, data");&lt;/P&gt;
&lt;P&gt;proc report data=target_stat nowd SPLIT='*' ;*completerows;&lt;BR /&gt;column state BiWeekly_target Category, Reached_status ('Total' Reached_status =tot);;&lt;BR /&gt;&lt;BR /&gt;define state / group width= 45 " Submitter";&lt;BR /&gt;define BiWeekly_target / group width= 45 " BiWeekly * Target";&lt;BR /&gt;define Category/ across width= 30 order= Internal "week ";&lt;BR /&gt;define Reached_status / sum width= 30 " ";&lt;BR /&gt;define tot / sum ' ';&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;Need to achieve..&lt;BR /&gt;1) Show all states irrespective of reached_status For ex: AL &amp;amp; AR- completerows is not working as desired&lt;BR /&gt;2) Add new column in report to show the difference BiWeekly_target- Reached_status&lt;BR /&gt;3) Add another column to show the percent difference.&lt;BR /&gt;4) Color, if difference is zero then target reached so it should be green, If diff greater than 75% then it should be yellow&lt;BR /&gt;otherwise red.&lt;BR /&gt;5) Is it possible to wrap the second row in the report( dates row)?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thank you&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;1) Your code shows *completerows; which would comment the option and not be used.&lt;/P&gt;
&lt;P&gt;Your columns statement shows a variable name Category that you do not show as being in your "have" data.&lt;/P&gt;
&lt;P&gt;Your output shows a column heading of "week" for the non-existant variable Category&lt;/P&gt;
&lt;P&gt;So I don't think you are showing either the code or the data you are actually using.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Start over providing actual data, in the form of a data step that will allow us to recreate a partial data set that will run with the code. Double check your code and post a corrected version that matches the data.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2021 23:54:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-color-coding-the-results-with-difference-in-total/m-p/721136#M223446</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-02-22T23:54:09Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report- color coding the results with difference in total</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-color-coding-the-results-with-difference-in-total/m-p/721140#M223449</link>
      <description>Category is nothing but the wk in my have data. Across made the columns as date fields and column header as week&lt;BR /&gt;define Category/ across width= 30 order= Internal "week ";&lt;BR /&gt;&lt;BR /&gt;I commented the completerows because it's creating unnecessary empty rows.&lt;BR /&gt;Hope this resolves confusion</description>
      <pubDate>Tue, 23 Feb 2021 00:21:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-color-coding-the-results-with-difference-in-total/m-p/721140#M223449</guid>
      <dc:creator>Stalk</dc:creator>
      <dc:date>2021-02-23T00:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report- color coding the results with difference in total</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-color-coding-the-results-with-difference-in-total/m-p/721166#M223467</link>
      <description>Hi:&lt;BR /&gt;  Without data in readable form, it is hard to guess. Without data, no one can run your code. It looks like your AL and AR rows do not have a value for Category or values for the reached status variable either. So in an across scenario, there's no category or week to put them under.&lt;BR /&gt;&lt;BR /&gt;  I don't think you need COMPLETEROWS here. And I'm not sure you need Bi-Weekly Target to be a group usage. if you have more than one row per state, per week, then don't you want all the bi_weekly_target values to be added up. That variable would need to be an analysis variable for that to happen. You only show one week for each state, but February has had more weeks than that, so at this point in time, shouldn't there be more rows for each state? This is why it is hard to guess at a possible solution.&lt;BR /&gt;&lt;BR /&gt; I don't know whether you posted actual data or a PROC PRINT or PROC REPORT output report where you show "have". Also, for ODS EXCEL, options like WIDTH=30 and I don't see the TOT column that you've created as an alias, so I wonder whether any of what you posted was created from a working program.&lt;BR /&gt;&lt;BR /&gt;Cynthia&lt;BR /&gt;</description>
      <pubDate>Tue, 23 Feb 2021 02:30:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-color-coding-the-results-with-difference-in-total/m-p/721166#M223467</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2021-02-23T02:30:27Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report- color coding the results with difference in total</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-color-coding-the-results-with-difference-in-total/m-p/721396#M223589</link>
      <description>Cynthia, thank you for your feedback..&lt;BR /&gt;Here is the  data and the code..&lt;BR /&gt;I want to show AL and AR on the report even thought they don't have any data.&lt;BR /&gt;My percentages are messed up. I would like to round to 100% it the total is greater than the biweekly target.  and color code based on the diff or pct.&lt;BR /&gt;red for any thing below 70% and yellow 71% to 89% and green for 90 and above.&lt;BR /&gt;data have;&lt;BR /&gt;  &lt;BR /&gt;  infile datalines;&lt;BR /&gt;  input State $	BiWeekly_target wk : date.	Reached_status ;&lt;BR /&gt;  &lt;BR /&gt;datalines;&lt;BR /&gt;&lt;BR /&gt;AK	15	20FEB2021	12&lt;BR /&gt;AL	11	 	 &lt;BR /&gt;AR	8	 	 &lt;BR /&gt;AZ	12	13FEB2021	8&lt;BR /&gt;CO	10	20FEB2021	9&lt;BR /&gt;CT	11	13FEB2021	11&lt;BR /&gt;DC	16	20FEB2021	12&lt;BR /&gt;DE	9	20FEB2021	9&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;proc report data=have nowd SPLIT='*' ;&lt;BR /&gt;  column  state BiWeekly_target wk, &lt;BR /&gt;         Reached_status ('Total' Reached_status =tot) diff diff_pct;	&lt;BR /&gt;	define state  / group width= 45 " State ";&lt;BR /&gt;	define BiWeekly_target / group width= 15 " Bi-Weekly * Counts";&lt;BR /&gt;    define wk/ across width= 30 order= Internal "week ";&lt;BR /&gt;    define Reached_status / sum width= 30 " ";&lt;BR /&gt;    define tot / sum ' ';&lt;BR /&gt;    define diff  / computed  "  shortage";&lt;BR /&gt;    compute diff;&lt;BR /&gt;    diff=BiWeekly_target -tot;&lt;BR /&gt;    endcomp;&lt;BR /&gt;    define diff_pct  / computed  " %  shortage" format=percent6. width=8;&lt;BR /&gt;    compute diff_pct;&lt;BR /&gt;    diff_pct=(tot/BiWeekly_target)*100;&lt;BR /&gt;   endcomp;&lt;BR /&gt;rbreak after / summarize;&lt;BR /&gt;run;</description>
      <pubDate>Tue, 23 Feb 2021 20:57:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-color-coding-the-results-with-difference-in-total/m-p/721396#M223589</guid>
      <dc:creator>Stalk</dc:creator>
      <dc:date>2021-02-23T20:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report- color coding the results with difference in total</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-color-coding-the-results-with-difference-in-total/m-p/721739#M223733</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I don't understand what you mean about rounding to 100% if the total is greater than the BiWeekly_Target. I don't understand why your calculation multiplies by 100 because the percent format that you've using also multiplies by 100, so I just changed your formula a bit. In order to use BiWeekly_Target in any calculation, you must use the compound name BiWeekly_Target.sum because BiWeekly_Target is an analysis variable with a usage of SUM. I also wasn't clear on the percents. The issue with your data, as you sent it is that you have missing values for WK for both AL and AR, so they don't have a place to fit under. Also your REACHED_STATUS for thos 2 rows is going to be missing, which will mess up the DIFF calculation and the percent calculation. I did the color coding that made sense to me, you might need to tweak it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Here's the slightly changed data and code I used:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_1-1614219227606.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/55143i3F6DFB10117E22BB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_1-1614219227606.png" alt="Cynthia_sas_1-1614219227606.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Note that I moved a lot of the column headers up into the column statement itself in order to simplify the headers for the ACROSS variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; And the output -- I only did the red and green because I did not really understand the rounding your envision. Also, see how AL and AR have 0 under the missing column for WK -- if their week value is missing and their reached_status value is missing, then there is no difference that can be calculated for them:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1614219193881.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/55142i42F4BCCE0E575FD2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1614219193881.png" alt="Cynthia_sas_0-1614219193881.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2021 02:16:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-color-coding-the-results-with-difference-in-total/m-p/721739#M223733</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2021-02-25T02:16:27Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report- color coding the results with difference in total</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-color-coding-the-results-with-difference-in-total/m-p/722172#M223888</link>
      <description>Thank you Cynthia for taking time to fix my code, especially the column header and percentages that are bothering me so much. I have one  question, some how my autofilter='all'  function is not working when I output to excel. Any thoughts?&lt;BR /&gt;</description>
      <pubDate>Fri, 26 Feb 2021 15:20:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-color-coding-the-results-with-difference-in-total/m-p/722172#M223888</guid>
      <dc:creator>Stalk</dc:creator>
      <dc:date>2021-02-26T15:20:46Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report- color coding the results with difference in total</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-color-coding-the-results-with-difference-in-total/m-p/722190#M223892</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I rarely use autofilter and when I do, I NEVER use ALL as the option. Usually, I have numeric variables in my output and I only like having autofilter on my character variables because those are usually the values I want to filter on. However, when I use ODS EXCEL with the same PROC REPORT code as previous posted, I do get autofilter on all the columns:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1614356786831.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/55232iEB0B6FD544EFC04F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1614356786831.png" alt="Cynthia_sas_0-1614356786831.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;But as I said, in this context, it doesn't make sense to me to have autofilter on anything other than the first column. The reason is that it doesn't make sense to work so hard at getting a particular structure to the output only to go and use autofilter on ALL the columns for this data. My inclination would be to just put autofilter like this:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_1-1614357099553.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/55234i6664B99E98C31AAD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_1-1614357099553.png" alt="Cynthia_sas_1-1614357099553.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; If you're having issues with autofilter, that's something you may want to work out with Tech Support. They have the ability to look at all your real data and your real code and take your version of SAS into account to help you come to a resolution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2021 16:33:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-color-coding-the-results-with-difference-in-total/m-p/722190#M223892</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2021-02-26T16:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report- color coding the results with difference in total</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-color-coding-the-results-with-difference-in-total/m-p/722335#M223961</link>
      <description>Thank you Cynthia. Autofilter for first column is working. &lt;BR /&gt;To answer your previous question: I don't understand what you mean about rounding to 100% if the total is greater than the BiWeekly_Target.&lt;BR /&gt;if the reached_status greater than BiWeekly target then the percentage i s exceeding 100% . Say for ex: AZ,  If I change the reached_status to 15 instead of  8. Percent will be 125%. In this case I would like to show that as 100%.</description>
      <pubDate>Sat, 27 Feb 2021 15:23:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-color-coding-the-results-with-difference-in-total/m-p/722335#M223961</guid>
      <dc:creator>Stalk</dc:creator>
      <dc:date>2021-02-27T15:23:30Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report- color coding the results with difference in total</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-color-coding-the-results-with-difference-in-total/m-p/722343#M223964</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Then I would probably change the COMPUTE block to alter and then do the highlighting based on the values of DIFF_PCT, as shown below:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1614447718416.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/55265i9883179E6A3C5161/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1614447718416.png" alt="Cynthia_sas_0-1614447718416.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Remember that the format is doing the multiply by 100 so the values you have to test are the decimal values after the division but before the format is applied.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Sat, 27 Feb 2021 17:43:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-color-coding-the-results-with-difference-in-total/m-p/722343#M223964</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2021-02-27T17:43:04Z</dc:date>
    </item>
  </channel>
</rss>

