<?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: Rank until it reaches a specific percentage. in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Rank-until-it-reaches-a-specific-percentage/m-p/639707#M35864</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
by location date;
retain ranking;
if first.date then ranking = 1;
output;
if cum_perc &amp;gt; 75 then ranking = .;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Untested, for lack of usable data.&lt;/P&gt;</description>
    <pubDate>Tue, 14 Apr 2020 12:07:25 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-04-14T12:07:25Z</dc:date>
    <item>
      <title>Rank until it reaches a specific percentage.</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Rank-until-it-reaches-a-specific-percentage/m-p/639702#M35863</link>
      <description>&lt;P&gt;Hello lads,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a quick question, I have built a cumulative column which sums up the percentages until it reaches 100. Now what I want to do is to make a new column named RANKING, which only puts a 1 as a value for the first N rows who together/combined reach a minimum of 75%. Everything else has to stay blank.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;DATA HAVE&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;ID -- Location -- Section -- Date -- - Type -- perc% --Cuml.perc%&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;01 -- Germany -- BB&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;--&lt;STRONG&gt;1/1/20&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;--&amp;nbsp; VW --&amp;nbsp; &amp;nbsp;20%&amp;nbsp; --20%&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;02 -- Germany -- AA&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;--&lt;STRONG&gt;1/1/20&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;--&amp;nbsp; AU --&amp;nbsp; &amp;nbsp; 20%&amp;nbsp; --40%&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;03 -- Germany -- AA&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;--&lt;STRONG&gt;1/1/20&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;--&amp;nbsp; AU --&amp;nbsp; &amp;nbsp; 30%&amp;nbsp; --70%&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;04 -- Germany -- BB&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;--&lt;STRONG&gt;1/1/20&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;--&amp;nbsp; AU --&amp;nbsp; &amp;nbsp; 10%&amp;nbsp; --80%&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;05 -- Germany -- BB&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;--1&lt;STRONG&gt;/1/20&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;--&amp;nbsp; MC --&amp;nbsp; &amp;nbsp;10%&amp;nbsp; --90%&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;06 -- Germany -- BB&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;--1&lt;STRONG&gt;/1/20&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;--&amp;nbsp; VW --&amp;nbsp; &amp;nbsp;10%&amp;nbsp; --100%&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;07 -- Germany -- AA&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;--2&lt;STRONG&gt;/1/20&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;--&amp;nbsp; OP --&amp;nbsp; &amp;nbsp; 25%&amp;nbsp; &amp;nbsp;--25%&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;08 -- Germany -- AA&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;--2&lt;STRONG&gt;/1/20&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;--&amp;nbsp; AU --&amp;nbsp; &amp;nbsp; 40%&amp;nbsp; &amp;nbsp;--65%&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;09 -- Germany -- BB&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;--2&lt;STRONG&gt;/1/20&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;--&amp;nbsp; MC --&amp;nbsp; &amp;nbsp;20%&amp;nbsp; &amp;nbsp;--85%&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;10 -- Germany -- BB&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;--2&lt;STRONG&gt;/1/20&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;--&amp;nbsp; MC --&amp;nbsp; &amp;nbsp;5%&amp;nbsp; &amp;nbsp; &amp;nbsp;--90%&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;11 -- Germany -- AA&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;--2&lt;STRONG&gt;/1/20&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;--&amp;nbsp; OP --&amp;nbsp; &amp;nbsp;5%&amp;nbsp; &amp;nbsp; &amp;nbsp;--95%&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;12 -- Germany -- AA&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;--2&lt;STRONG&gt;/1/20&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;--&amp;nbsp; VW --&amp;nbsp; &amp;nbsp;5%&amp;nbsp; &amp;nbsp; --100%&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;DATA WANT:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;ID -- Location -- Section -- Date -- - Type -- perc% --Cuml.perc% --RANKING&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;01 -- Germany -- BB&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;--&lt;STRONG&gt;1/1/20&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;--&amp;nbsp; VW --&amp;nbsp; &amp;nbsp;20%&amp;nbsp; --20%&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;--&amp;nbsp; 1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;02 -- Germany -- AA&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;--&lt;STRONG&gt;1/1/20&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;--&amp;nbsp; AU --&amp;nbsp; &amp;nbsp; 20%&amp;nbsp; --40%&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;--&amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;03 -- Germany -- AA&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;--&lt;STRONG&gt;1/1/20&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;--&amp;nbsp; AU --&amp;nbsp; &amp;nbsp; 30%&amp;nbsp; --70%&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;--&amp;nbsp; 1&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;04 -- Germany -- BB&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;--&lt;STRONG&gt;1/1/20&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;--&amp;nbsp; AU --&amp;nbsp; &amp;nbsp; 10%&amp;nbsp; --80%&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;--&amp;nbsp; 1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;05 -- Germany -- BB&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;--1&lt;STRONG&gt;/1/20&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;--&amp;nbsp; MC --&amp;nbsp; &amp;nbsp;10%&amp;nbsp; --90%&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; --&amp;nbsp; &amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;06 -- Germany -- BB&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;--1&lt;STRONG&gt;/1/20&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;--&amp;nbsp; VW --&amp;nbsp; &amp;nbsp;10%&amp;nbsp; --100%&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;--&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;07 -- Germany -- AA&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;--2&lt;STRONG&gt;/1/20&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;--&amp;nbsp; OP --&amp;nbsp; &amp;nbsp; 25%&amp;nbsp; &amp;nbsp;--25%&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; --&amp;nbsp; &amp;nbsp;1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;08 -- Germany -- AA&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;--2&lt;STRONG&gt;/1/20&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;--&amp;nbsp; AU --&amp;nbsp; &amp;nbsp; 40%&amp;nbsp; &amp;nbsp; --65%&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; --&amp;nbsp; &amp;nbsp;1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;09 -- Germany -- BB&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;--2&lt;STRONG&gt;/1/20&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;--&amp;nbsp; MC --&amp;nbsp; &amp;nbsp;20%&amp;nbsp; &amp;nbsp;--85%&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; --&amp;nbsp; 1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;10 -- Germany -- BB&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;--2&lt;STRONG&gt;/1/20&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;--&amp;nbsp; MC --&amp;nbsp; &amp;nbsp;5%&amp;nbsp; &amp;nbsp; &amp;nbsp; --90%&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;--&amp;nbsp; &amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;11 -- Germany -- AA&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;--2&lt;STRONG&gt;/1/20&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;--&amp;nbsp; OP --&amp;nbsp; &amp;nbsp;5%&amp;nbsp; &amp;nbsp; &amp;nbsp;--95%&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;--&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;12 -- Germany -- AA&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;--2&lt;STRONG&gt;/1/20&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;--&amp;nbsp; VW --&amp;nbsp; &amp;nbsp;5%&amp;nbsp; &amp;nbsp; --100%&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; --&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;I hope its clear guys, I appreciate&amp;nbsp;your help. Thank you in advance!&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2020 11:51:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Rank-until-it-reaches-a-specific-percentage/m-p/639702#M35863</guid>
      <dc:creator>AK100</dc:creator>
      <dc:date>2020-04-14T11:51:27Z</dc:date>
    </item>
    <item>
      <title>Re: Rank until it reaches a specific percentage.</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Rank-until-it-reaches-a-specific-percentage/m-p/639707#M35864</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
by location date;
retain ranking;
if first.date then ranking = 1;
output;
if cum_perc &amp;gt; 75 then ranking = .;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Untested, for lack of usable data.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2020 12:07:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Rank-until-it-reaches-a-specific-percentage/m-p/639707#M35864</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-04-14T12:07:25Z</dc:date>
    </item>
    <item>
      <title>Re: Rank until it reaches a specific percentage.</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Rank-until-it-reaches-a-specific-percentage/m-p/639709#M35865</link>
      <description>&lt;PRE&gt;data want;
set have;
ranking=lag(cumlperc);
if cumlperc le 0.75 then ranking=1;
else if ranking lt 0.75 then ranking=1;
else ranking=.;
run;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #fcfaf3; color: #242729; font-family: inherit; font-size: 100%; font-size-adjust: none; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; letter-spacing: normal; line-height: inherit; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;I hope this can help you&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2020 12:11:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Rank-until-it-reaches-a-specific-percentage/m-p/639709#M35865</guid>
      <dc:creator>kelxxx</dc:creator>
      <dc:date>2020-04-14T12:11:02Z</dc:date>
    </item>
    <item>
      <title>Re: Rank until it reaches a specific percentage.</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Rank-until-it-reaches-a-specific-percentage/m-p/639710#M35866</link>
      <description>Thanks, this worked perfectly</description>
      <pubDate>Tue, 14 Apr 2020 12:14:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Rank-until-it-reaches-a-specific-percentage/m-p/639710#M35866</guid>
      <dc:creator>AK100</dc:creator>
      <dc:date>2020-04-14T12:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: Rank until it reaches a specific percentage.</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Rank-until-it-reaches-a-specific-percentage/m-p/639711#M35867</link>
      <description>&lt;P&gt;Thanks Kurt, &lt;BR /&gt;&lt;BR /&gt;I think I can use this one if I change a few things, for now it says 'by variables not properly sorted'.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2020 12:16:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Rank-until-it-reaches-a-specific-percentage/m-p/639711#M35867</guid>
      <dc:creator>AK100</dc:creator>
      <dc:date>2020-04-14T12:16:45Z</dc:date>
    </item>
    <item>
      <title>Re: Rank until it reaches a specific percentage.</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Rank-until-it-reaches-a-specific-percentage/m-p/639712#M35868</link>
      <description>&lt;P&gt;As I said, untested.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2020 12:16:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Rank-until-it-reaches-a-specific-percentage/m-p/639712#M35868</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-04-14T12:16:35Z</dc:date>
    </item>
    <item>
      <title>Re: Rank until it reaches a specific percentage.</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Rank-until-it-reaches-a-specific-percentage/m-p/644477#M35951</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt; and&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/235012"&gt;@kelxxx&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The code you gave me worked perfectly until I got a first variable who directly was greater then or equal to 0.75. That one did not get a ranking 1. It only gets a ranking when the first codes few coded together reach 0.75 but like I said now I have one who directly reaches 0.75+. This is the code I used right now, but it doesnt work:&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data matselectie1;
	set percentage_count;
	Selectie=lag(totpercentage);

	if totpercentage le 0.75 then
		Selectie=1;
	else if FIRST.totpercentage=1 ge 0.75 then
		Selectie=1;
	else if Selectie lt 0.75 then
		Selectie=1;
	else Selectie=.;
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 May 2020 10:28:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Rank-until-it-reaches-a-specific-percentage/m-p/644477#M35951</guid>
      <dc:creator>AK100</dc:creator>
      <dc:date>2020-05-01T10:28:44Z</dc:date>
    </item>
    <item>
      <title>Re: Rank until it reaches a specific percentage.</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Rank-until-it-reaches-a-specific-percentage/m-p/644486#M35953</link>
      <description>&lt;P&gt;I hate to repeat myself, but: "untested, for lack of usable data". "Usable data" also includes "edge cases" like the one you described.&lt;/P&gt;</description>
      <pubDate>Fri, 01 May 2020 10:56:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Rank-until-it-reaches-a-specific-percentage/m-p/644486#M35953</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-05-01T10:56:04Z</dc:date>
    </item>
  </channel>
</rss>

