<?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: Between (2 percentages) Function in Case Statement with Calculation in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Between-2-percentages-Function-in-Case-Statement-with/m-p/292305#M19957</link>
    <description>&lt;P&gt;Thank you PG !&lt;/P&gt;</description>
    <pubDate>Wed, 17 Aug 2016 21:46:17 GMT</pubDate>
    <dc:creator>chrisjab</dc:creator>
    <dc:date>2016-08-17T21:46:17Z</dc:date>
    <item>
      <title>Between (2 percentages) Function in Case Statement with Calculation</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Between-2-percentages-Function-in-Case-Statement-with/m-p/292288#M19955</link>
      <description>&lt;P&gt;Good Afternoon,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create a case statement where the defined criteria are in percentages and the conditions are in Dollars; given the differences between the criteria and the defined conditions I am running into rounding issues resulting in transactions being left out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, I have 3 columns identified as:&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Sale_Beverage&lt;/LI&gt;&lt;LI&gt;Sale_Food&lt;/LI&gt;&lt;LI&gt;Total_ Sales&amp;nbsp;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;With this information, I am trying to group the percentage of Beverage and Food sales into the following defined categories:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;If Total_Sales = $0 then "No Activity"&lt;/LI&gt;&lt;LI&gt;If (Sale_Food/ Total_Sales) &amp;gt;= 80% then "FoodH"&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;If (Sale_Food/ Total_Sales)&lt;/SPAN&gt; between 55% and 79% then "FoodM"&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;If (Sale_Food/ Total_Sales)&lt;/SPAN&gt; between 45% and 54% the "FoodL"&lt;/LI&gt;&lt;LI&gt;.....&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Given the criteria this is what I came up with:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CASE&lt;BR /&gt;WHEN Total_Sales = 0&lt;BR /&gt;THEN "No Activity"&lt;BR /&gt;WHEN (Sale_Food/Total_Sales)&amp;gt;= 0.80&lt;FONT color="#339966"&gt;&lt;EM&gt;&amp;nbsp;-- for 80%&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;SPAN&gt;THEN "FoodH"&lt;/SPAN&gt;&lt;BR /&gt;WHEN (&lt;SPAN&gt;Sale_Food/Total_Sales) BETWEEN 0.55 and 0.79&lt;/SPAN&gt;&lt;FONT color="#339966"&gt;&lt;EM&gt;&amp;nbsp;-- for between 55% &amp;nbsp;and 79%&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;THEN "FoodM"&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;END&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be gladly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Wed, 17 Aug 2016 20:34:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Between-2-percentages-Function-in-Case-Statement-with/m-p/292288#M19955</guid>
      <dc:creator>chrisjab</dc:creator>
      <dc:date>2016-08-17T20:34:06Z</dc:date>
    </item>
    <item>
      <title>Re: Between (2 percentages) Function in Case Statement with Calculation</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Between-2-percentages-Function-in-Case-Statement-with/m-p/292293#M19956</link>
      <description>&lt;P&gt;Use the fact that case clauses are tested in order until one matches. Make sure you cover all possibilities&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;CASE
WHEN Total_Sales = 0
	THEN "No Activity"
WHEN (Sale_Food/Total_Sales) &amp;lt; 0.45
	THEN "Food?"
WHEN (Sale_Food/Total_Sales) &amp;lt; 0.55
	THEN "FoodL"
WHEN (Sale_Food/Total_Sales) &amp;lt; 0.80
	THEN "FoodM"
	ELSE "FoodH"
END as Category&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Aug 2016 20:51:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Between-2-percentages-Function-in-Case-Statement-with/m-p/292293#M19956</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-08-17T20:51:47Z</dc:date>
    </item>
    <item>
      <title>Re: Between (2 percentages) Function in Case Statement with Calculation</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Between-2-percentages-Function-in-Case-Statement-with/m-p/292305#M19957</link>
      <description>&lt;P&gt;Thank you PG !&lt;/P&gt;</description>
      <pubDate>Wed, 17 Aug 2016 21:46:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Between-2-percentages-Function-in-Case-Statement-with/m-p/292305#M19957</guid>
      <dc:creator>chrisjab</dc:creator>
      <dc:date>2016-08-17T21:46:17Z</dc:date>
    </item>
  </channel>
</rss>

