<?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 values in a column in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Conditional-values-in-a-column/m-p/228063#M41153</link>
    <description>&lt;P&gt;What destination are you sending you data to? HTML, RTF, PDF or something else?&lt;/P&gt;
&lt;P&gt;What procedure are you attempting to use?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Different procedures and destinations likely require different approaches.&lt;/P&gt;</description>
    <pubDate>Thu, 01 Oct 2015 15:14:08 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2015-10-01T15:14:08Z</dc:date>
    <item>
      <title>Conditional values in a column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Conditional-values-in-a-column/m-p/228055#M41150</link>
      <description>&lt;P&gt;If sales on 30-Sep is greater than MTD_Sales then Color should be green for all the dates of a product. Else the color should be red for all the dates of that product.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2015 14:32:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Conditional-values-in-a-column/m-p/228055#M41150</guid>
      <dc:creator>Ira</dc:creator>
      <dc:date>2015-10-01T14:32:48Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional values in a column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Conditional-values-in-a-column/m-p/228063#M41153</link>
      <description>&lt;P&gt;What destination are you sending you data to? HTML, RTF, PDF or something else?&lt;/P&gt;
&lt;P&gt;What procedure are you attempting to use?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Different procedures and destinations likely require different approaches.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2015 15:14:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Conditional-values-in-a-column/m-p/228063#M41153</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-10-01T15:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional values in a column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Conditional-values-in-a-column/m-p/228065#M41155</link>
      <description>&lt;P&gt;If you are looking for the code and not the report here you go:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data have;&lt;BR /&gt;infile cards;&lt;BR /&gt;input product$ date mtd_sales goal;&lt;BR /&gt;informat date date9.;&lt;BR /&gt;format date date9.;&lt;BR /&gt;cards;&lt;BR /&gt;Handbags 21-Sep-15 23 50&lt;BR /&gt;Handbags 22-Sep-15 25 50&lt;BR /&gt;Handbags 23-Sep-15 28 50&lt;BR /&gt;Handbags 24-Sep-15 29 50&lt;BR /&gt;Handbags 25-Sep-15 33 50&lt;BR /&gt;Handbags 26-Sep-15 34 50&lt;BR /&gt;Handbags 27-Sep-15 37 50&lt;BR /&gt;Handbags 28-Sep-15 40 50&lt;BR /&gt;Handbags 29-Sep-15 44 50&lt;BR /&gt;Handbags 30-Sep-15 45 50&lt;BR /&gt;Shoes&amp;nbsp;&amp;nbsp;&amp;nbsp; 21-Sep-15 38 70&lt;BR /&gt;Shoes&amp;nbsp;&amp;nbsp;&amp;nbsp; 22-Sep-15 44 70&lt;BR /&gt;Shoes&amp;nbsp;&amp;nbsp;&amp;nbsp; 23-Sep-15 46 70&lt;BR /&gt;Shoes&amp;nbsp;&amp;nbsp;&amp;nbsp; 24-Sep-15 47 70&lt;BR /&gt;Shoes&amp;nbsp;&amp;nbsp;&amp;nbsp; 25-Sep-15 49 70&lt;BR /&gt;Shoes&amp;nbsp;&amp;nbsp;&amp;nbsp; 26-Sep-15 57 70&lt;BR /&gt;Shoes&amp;nbsp;&amp;nbsp;&amp;nbsp; 27-Sep-15 63 70&lt;BR /&gt;Shoes&amp;nbsp;&amp;nbsp;&amp;nbsp; 28-Sep-15 68 70&lt;BR /&gt;Shoes&amp;nbsp;&amp;nbsp;&amp;nbsp; 29-Sep-15 72 70&lt;BR /&gt;Shoes&amp;nbsp;&amp;nbsp;&amp;nbsp; 30-Sep-15 74 70&lt;BR /&gt;;&lt;BR /&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;create table want as&lt;BR /&gt;select product,date,mtd_sales,goal,max(color) as color&lt;BR /&gt;from (&lt;BR /&gt;select *,&lt;BR /&gt;case&lt;BR /&gt;when date = '30sep2015'd and mtd_sales &amp;gt; goal then 'GREEN'&lt;BR /&gt;when date = '30sep2015'd and mtd_sales &amp;lt; goal then 'RED'&lt;BR /&gt;end as Color&lt;BR /&gt;from have)&lt;BR /&gt;group by product;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2015 15:18:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Conditional-values-in-a-column/m-p/228065#M41155</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-10-01T15:18:20Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional values in a column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Conditional-values-in-a-column/m-p/228068#M41156</link>
      <description>or this:&lt;BR /&gt;data want(drop=flag);&lt;BR /&gt;do until(last.product);&lt;BR /&gt;set have;&lt;BR /&gt;by product;&lt;BR /&gt;if date = '30sep2015'd and mtd_sales &amp;gt; goal then flag = 1;&lt;BR /&gt;end;&lt;BR /&gt;do until(last.product);&lt;BR /&gt;set have;&lt;BR /&gt;by product;&lt;BR /&gt;if flag = 1 then Color = 'GREEN';&lt;BR /&gt;else color = 'RED';&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;run;</description>
      <pubDate>Thu, 01 Oct 2015 15:31:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Conditional-values-in-a-column/m-p/228068#M41156</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-10-01T15:31:51Z</dc:date>
    </item>
  </channel>
</rss>

