<?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: Selecting the cumulative till I reach 75% in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-cumulative-till-I-reach-75/m-p/636084#M35751</link>
    <description>That was a good one &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13711"&gt;@art297&lt;/a&gt;.</description>
    <pubDate>Tue, 31 Mar 2020 05:38:03 GMT</pubDate>
    <dc:creator>AK100</dc:creator>
    <dc:date>2020-03-31T05:38:03Z</dc:date>
    <item>
      <title>Selecting the cumulative till I reach 75%</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-cumulative-till-I-reach-75/m-p/635810#M35744</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I'am quite new to SAS EG and I want to get the following: I want to select all the measurements who have the highest percentage (from high to low per month &lt;STRONG&gt;AND&lt;/STRONG&gt; section) till I reach a cumulative total percentage of minimal 75%. .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So (see screenshot) from the month &lt;STRONG&gt;July&lt;/STRONG&gt; and section &lt;STRONG&gt;2632CT&lt;/STRONG&gt; I want to select just the percentage 53% + &lt;STRONG&gt;28%&lt;/STRONG&gt; in a cumulative column. For the month &lt;STRONG&gt;July&lt;/STRONG&gt; and section &lt;STRONG&gt;2646BT&lt;/STRONG&gt; I want to select just &lt;STRONG&gt;49%&lt;/STRONG&gt; and &lt;STRONG&gt;26%&lt;/STRONG&gt; in cumulative etc. So I just want to select the highest percentages in a cumulative form until I reach a minimal of 75%. The count has to start from 0 again at the beginning of every new section (so actually 2x per month)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AK100_0-1585575375169.png" style="width: 467px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/37544i4DB5C7D6877EC66D/image-dimensions/467x578?v=v2" width="467" height="578" role="button" title="AK100_0-1585575375169.png" alt="AK100_0-1585575375169.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope its all clear, I appreciate your help.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Mar 2020 13:44:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-cumulative-till-I-reach-75/m-p/635810#M35744</guid>
      <dc:creator>AK100</dc:creator>
      <dc:date>2020-03-30T13:44:50Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting the cumulative till I reach 75%</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-cumulative-till-I-reach-75/m-p/635812#M35745</link>
      <description>&lt;P&gt;Sort by month, section and descending percentage;&lt;/P&gt;
&lt;P&gt;Then do&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
by maand1 sectie;
if sum_perc le .75 then output;
if first.section
then sum_perc = percentage;
else sum_perc + percentage; /* causes automatic retain */
drop sum_perc;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 30 Mar 2020 13:56:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-cumulative-till-I-reach-75/m-p/635812#M35745</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-03-30T13:56:10Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting the cumulative till I reach 75%</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-cumulative-till-I-reach-75/m-p/635830#M35746</link>
      <description>&lt;P&gt;Slight problem with the code suggested by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;. I'd use:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=have out=need;
  by maand1 sectie descending percentage;
run;

data want;
  set need;
  by maand1 sectie;
  if first.sectie then sum_perc = 0;
  if sum_perc lt .75 then do;
    sum_perc+percentage;
    output;
  end;
  drop sum_perc;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;</description>
      <pubDate>Mon, 30 Mar 2020 14:54:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-cumulative-till-I-reach-75/m-p/635830#M35746</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2020-03-30T14:54:23Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting the cumulative till I reach 75%</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-cumulative-till-I-reach-75/m-p/635843#M35748</link>
      <description>&lt;P&gt;Happens when you have no data to test against.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Mar 2020 15:16:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-cumulative-till-I-reach-75/m-p/635843#M35748</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-03-30T15:16:54Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting the cumulative till I reach 75%</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-cumulative-till-I-reach-75/m-p/636084#M35751</link>
      <description>That was a good one &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13711"&gt;@art297&lt;/a&gt;.</description>
      <pubDate>Tue, 31 Mar 2020 05:38:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-cumulative-till-I-reach-75/m-p/636084#M35751</guid>
      <dc:creator>AK100</dc:creator>
      <dc:date>2020-03-31T05:38:03Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting the cumulative till I reach 75%</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-cumulative-till-I-reach-75/m-p/636085#M35752</link>
      <description>thx.</description>
      <pubDate>Tue, 31 Mar 2020 05:38:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-the-cumulative-till-I-reach-75/m-p/636085#M35752</guid>
      <dc:creator>AK100</dc:creator>
      <dc:date>2020-03-31T05:38:23Z</dc:date>
    </item>
  </channel>
</rss>

