<?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: Calculate Percentage incorrect ?? in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Calculate-Percentage-incorrect/m-p/112816#M9582</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Tom,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I changed the PERCENT6 TO PERCENT8 &amp;amp; it now calculates correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks !! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Oct 2013 03:48:17 GMT</pubDate>
    <dc:creator>pcfriendly</dc:creator>
    <dc:date>2013-10-15T03:48:17Z</dc:date>
    <item>
      <title>Calculate Percentage incorrect ??</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Calculate-Percentage-incorrect/m-p/112811#M9577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using SAS EG 4.3 with Windows 7 &amp;amp; am trying to perform a calculation of a % of a Currency amount.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example, I have 2 Fileds on a table, Sales (Currency) &amp;amp; Allocation (%) - NOTE the datatypes appear as shown ie; $ &amp;amp; %.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I go to Query Builder &amp;gt;&amp;gt; Add the 2 Fields to the Builder &amp;gt;&amp;gt; go to Add Computed Column &amp;gt;&amp;gt; Select Advanced Expression &amp;amp; enter;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;t1.Sales*Allocation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The figures for this example are Currency is $180.00 &amp;amp; the Percentage is 22%.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The result for 22% of $180.00 should be $39.60 but I am getting $38.74 ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I then reloaded my % Field as a Number datatype &amp;amp; tried the below;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;t1.Sales*(Allocation/100) same result ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My goal is to apply the % Allocation figure against the sales figure to get the % of the Sales in this new Column.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Oct 2013 02:34:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Calculate-Percentage-incorrect/m-p/112811#M9577</guid>
      <dc:creator>pcfriendly</dc:creator>
      <dc:date>2013-10-15T02:34:19Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Percentage incorrect ??</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Calculate-Percentage-incorrect/m-p/112812#M9578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From the $ amount you are getting it looks the percentage is less than 22% and it is just being rounded in your display.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;s=180 p=0.22 n=39.6&lt;/P&gt;&lt;P&gt;s=180 p=0.2152222222 n=38.74&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Oct 2013 03:15:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Calculate-Percentage-incorrect/m-p/112812#M9578</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-10-15T03:15:46Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Percentage incorrect ??</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Calculate-Percentage-incorrect/m-p/112813#M9579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Tom,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The number is being entered as 22 though?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to make it not round the number? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Oct 2013 03:18:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Calculate-Percentage-incorrect/m-p/112813#M9579</guid>
      <dc:creator>pcfriendly</dc:creator>
      <dc:date>2013-10-15T03:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Percentage incorrect ??</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Calculate-Percentage-incorrect/m-p/112814#M9580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I cannot see how entering the number as 22 (or really 0.22) could cause it to get that far off.&lt;/P&gt;&lt;P&gt;If you are storing the value in a permanent dataset make sure that the length of the variable is 8.&amp;nbsp; On machines that use IEEE floating point (unix and windows) you can store numbers in as little as 3 bytes, but then SAS just throws away the rest of the bits used to represent the floating point number.&amp;nbsp; If you try to store .22 into just 3 bytes when you read it back you get. 0.2199707031.&lt;/P&gt;&lt;P&gt;On an IBM mainframe you can even define a numeric variable as length 2, but even then it should not get as low as 0.21522222.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Oct 2013 03:40:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Calculate-Percentage-incorrect/m-p/112814#M9580</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-10-15T03:40:02Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Percentage incorrect ??</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Calculate-Percentage-incorrect/m-p/112815#M9581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK, The length of the field is 8, the Type is Number &amp;amp; the Source Informat / Output Format / Output Informat are all PERCENT6.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could the PERCENT6 be the problem? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Oct 2013 03:44:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Calculate-Percentage-incorrect/m-p/112815#M9581</guid>
      <dc:creator>pcfriendly</dc:creator>
      <dc:date>2013-10-15T03:44:52Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Percentage incorrect ??</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Calculate-Percentage-incorrect/m-p/112816#M9582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Tom,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I changed the PERCENT6 TO PERCENT8 &amp;amp; it now calculates correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks !! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Oct 2013 03:48:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Calculate-Percentage-incorrect/m-p/112816#M9582</guid>
      <dc:creator>pcfriendly</dc:creator>
      <dc:date>2013-10-15T03:48:17Z</dc:date>
    </item>
  </channel>
</rss>

