<?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 Percentage of values that increase out of total number of values which shows a change. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Percentage-of-values-that-increase-out-of-total-number-of-values/m-p/846825#M334767</link>
    <description>&lt;P&gt;&lt;SPAN&gt;I have two columns in a table.&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to find the number of rows in which the number in Rating_a is bigger than the number in Rating_b and then divide that number by the total number of rows in the table in which the value changes. So when dividing, I won't be taking into account those rows in which the values in Rating_a and Rating_b are the same. For instance, in the following table, the result I'd be looking for is 2/4 = 50%. I divide by 4 instead of 6 because 2 rows have the same values. And in the numerator I wrote 2 because only in 2 rows, rating_a is bigger than rating_b. Help would be appreciated in coming up with a code that deals with this since I'm dealing with 1000s of rows in my table. Thank you.&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's a sample (actual table has 1000s of rows) of how it looks like:&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="50%" height="30px"&gt;&lt;SPAN&gt;&lt;STRONG&gt;Rating_a&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;
&lt;TD width="50%" height="30px"&gt;&lt;SPAN&gt;&lt;STRONG&gt;Rating_b&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%" height="30px"&gt;1&lt;/TD&gt;
&lt;TD width="50%" height="30px"&gt;3&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%" height="30px"&gt;2&lt;/TD&gt;
&lt;TD width="50%" height="30px"&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%" height="30px"&gt;4&lt;/TD&gt;
&lt;TD width="50%" height="30px"&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%" height="30px"&gt;4&lt;/TD&gt;
&lt;TD width="50%" height="30px"&gt;4&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%" height="30px"&gt;2&lt;/TD&gt;
&lt;TD width="50%" height="30px"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;TD&gt;4&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 29 Nov 2022 14:45:55 GMT</pubDate>
    <dc:creator>SASuser4321</dc:creator>
    <dc:date>2022-11-29T14:45:55Z</dc:date>
    <item>
      <title>Percentage of values that increase out of total number of values which shows a change.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Percentage-of-values-that-increase-out-of-total-number-of-values/m-p/846825#M334767</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I have two columns in a table.&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to find the number of rows in which the number in Rating_a is bigger than the number in Rating_b and then divide that number by the total number of rows in the table in which the value changes. So when dividing, I won't be taking into account those rows in which the values in Rating_a and Rating_b are the same. For instance, in the following table, the result I'd be looking for is 2/4 = 50%. I divide by 4 instead of 6 because 2 rows have the same values. And in the numerator I wrote 2 because only in 2 rows, rating_a is bigger than rating_b. Help would be appreciated in coming up with a code that deals with this since I'm dealing with 1000s of rows in my table. Thank you.&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's a sample (actual table has 1000s of rows) of how it looks like:&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="50%" height="30px"&gt;&lt;SPAN&gt;&lt;STRONG&gt;Rating_a&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;
&lt;TD width="50%" height="30px"&gt;&lt;SPAN&gt;&lt;STRONG&gt;Rating_b&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%" height="30px"&gt;1&lt;/TD&gt;
&lt;TD width="50%" height="30px"&gt;3&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%" height="30px"&gt;2&lt;/TD&gt;
&lt;TD width="50%" height="30px"&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%" height="30px"&gt;4&lt;/TD&gt;
&lt;TD width="50%" height="30px"&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%" height="30px"&gt;4&lt;/TD&gt;
&lt;TD width="50%" height="30px"&gt;4&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%" height="30px"&gt;2&lt;/TD&gt;
&lt;TD width="50%" height="30px"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;TD&gt;4&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2022 14:45:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Percentage-of-values-that-increase-out-of-total-number-of-values/m-p/846825#M334767</guid>
      <dc:creator>SASuser4321</dc:creator>
      <dc:date>2022-11-29T14:45:55Z</dc:date>
    </item>
    <item>
      <title>Re: Percentage of values that increase out of total number of values which shows a change.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Percentage-of-values-that-increase-out-of-total-number-of-values/m-p/846830#M334772</link>
      <description>&lt;P&gt;Since you marked an answer correct to your other question, can you see if you can make the simple modifications to that answer? Show us what you have tried.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2022 14:55:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Percentage-of-values-that-increase-out-of-total-number-of-values/m-p/846830#M334772</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-11-29T14:55:11Z</dc:date>
    </item>
    <item>
      <title>Re: Percentage of values that increase out of total number of values which shows a change.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Percentage-of-values-that-increase-out-of-total-number-of-values/m-p/846835#M334776</link>
      <description>&lt;P&gt;I figured it out on my own.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;select sum(rating_a &amp;gt; rating_b) / sum(rating_a ne rating_b) from have;&lt;BR /&gt;quit;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2022 15:06:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Percentage-of-values-that-increase-out-of-total-number-of-values/m-p/846835#M334776</guid>
      <dc:creator>SASuser4321</dc:creator>
      <dc:date>2022-11-29T15:06:06Z</dc:date>
    </item>
  </channel>
</rss>

