<?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: Sum up with in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Sum-up-with/m-p/208650#M51716</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you want&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select sum((scorex ne 0)*weightx)/sum((scorex=1)*weightx) as score&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Aug 2015 18:27:57 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2015-08-27T18:27:57Z</dc:date>
    <item>
      <title>Sum up with</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Sum-up-with/m-p/208646#M51712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I created a table named rentals. This is what it pulls back.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;ScoreX&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;WeightX&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;0&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;23&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;0&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;45&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;4&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt; I need to come up with the result being &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Score&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Which is a formula of (sum All weightX wher scoreX not = to 0) / (sum All weightx where score = to 1)&lt;/P&gt;&lt;P&gt;so&lt;/P&gt;&lt;P&gt;60/20&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I do this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Aug 2015 14:24:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Sum-up-with/m-p/208646#M51712</guid>
      <dc:creator>Mattress58</dc:creator>
      <dc:date>2015-08-27T14:24:23Z</dc:date>
    </item>
    <item>
      <title>Re: Sum up with</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Sum-up-with/m-p/208647#M51713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data oink;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set rentals end=eof;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if scoreX^=0 then numerator+weightx;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if scoreX=1 then denominator+weightx;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if eof then score=numerator/denominator;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Aug 2015 14:33:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Sum-up-with/m-p/208647#M51713</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2015-08-27T14:33:37Z</dc:date>
    </item>
    <item>
      <title>Re: Sum up with</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Sum-up-with/m-p/208648#M51714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's 68/20=3.4 given your data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's a SQL solution...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; create table want as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; select sum((scorex=0)*weightx)/sum((scorex=1)*weightx) as score&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; from have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Aug 2015 14:48:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Sum-up-with/m-p/208648#M51714</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-08-27T14:48:30Z</dc:date>
    </item>
    <item>
      <title>Re: Sum up with</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Sum-up-with/m-p/208649#M51715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you both for the help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Aug 2015 16:11:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Sum-up-with/m-p/208649#M51715</guid>
      <dc:creator>Mattress58</dc:creator>
      <dc:date>2015-08-27T16:11:45Z</dc:date>
    </item>
    <item>
      <title>Re: Sum up with</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Sum-up-with/m-p/208650#M51716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you want&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select sum((scorex ne 0)*weightx)/sum((scorex=1)*weightx) as score&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Aug 2015 18:27:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Sum-up-with/m-p/208650#M51716</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2015-08-27T18:27:57Z</dc:date>
    </item>
  </channel>
</rss>

