<?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 Unique in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Rank-Unique/m-p/286679#M55335</link>
    <description>&lt;P&gt;If you want a column formula this should work. Independent of sorting.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Local( {L = Associative Array( :Label ) &amp;lt;&amp;lt; get keys}, Loc( L, :Label ) )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Same approach could be used in JSL without a column formula.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();
dt &amp;lt;&amp;lt; New Column( "Rank Unique", continuous );
L = Associative Array( :Label ) &amp;lt;&amp;lt; get keys;
For Each Row( :Rank Unique = Loc( L, :Label ) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 19 Aug 2020 09:29:04 GMT</pubDate>
    <dc:creator>ms</dc:creator>
    <dc:date>2020-08-19T09:29:04Z</dc:date>
    <item>
      <title>Rank Unique</title>
      <link>https://community.jmp.com/t5/Discussions/Rank-Unique/m-p/286665#M55330</link>
      <description>&lt;P&gt;I want to calculate a new column to rank a column uniquely. Below are the example output that i want to achieve. But by using the JSL rank formula doesn't help me to achieve what i want. Can anyone please advise me?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The formula i use is Col Rank(:Label)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;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MAX_PRG_EVENR2_DCMP[1],86491,max&lt;/TD&gt;&lt;TD&gt;9&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Fri, 09 Jun 2023 23:35:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Rank-Unique/m-p/286665#M55330</guid>
      <dc:creator>OneNorthJMP</dc:creator>
      <dc:date>2023-06-09T23:35:23Z</dc:date>
    </item>
    <item>
      <title>Re: Rank Unique</title>
      <link>https://community.jmp.com/t5/Discussions/Rank-Unique/m-p/286674#M55331</link>
      <description>&lt;P&gt;There are a couple of ways to do this....(that I can think of, this early in the morning)&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Use a summary table to create the ranks
&lt;OL&gt;
&lt;LI&gt;Run Tables==&amp;gt;Summary&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;Group by your Label column&lt;/LI&gt;
&lt;LI&gt;Assuming the output data table is sorted from low to high, create a new column called "Rank" and give it the formula........Row()&lt;/LI&gt;
&lt;LI&gt;Run&amp;nbsp; &amp;nbsp; Tables==&amp;gt;Update to join the summary table back to the original table, matching on the Label column&lt;/LI&gt;
&lt;/OL&gt;
&lt;/LI&gt;
&lt;LI&gt;Create a new Rank formula column
&lt;OL&gt;
&lt;LI&gt;Sort the data by Label&lt;/LI&gt;
&lt;LI&gt;Create a new column called Rank with the formula
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If( Row() == 1,
	count = 1,
	If( :Label != Lag( :Label ),
		count
		++)
);
count;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI&gt;
&lt;LI&gt;Be sure to go to Column Info and remove the after the column is created.&amp;nbsp; The reason for this is that since the formula is based upon the order of the data, and the completeness of the data, any changes in the data(sorting etc.) will rerun the formula and possibly change the rankings.&lt;/LI&gt;
&lt;/OL&gt;
&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Wed, 19 Aug 2020 08:58:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Rank-Unique/m-p/286674#M55331</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-08-19T08:58:40Z</dc:date>
    </item>
    <item>
      <title>Re: Rank Unique</title>
      <link>https://community.jmp.com/t5/Discussions/Rank-Unique/m-p/286676#M55332</link>
      <description>Hi Jim,&lt;BR /&gt;&lt;BR /&gt;Thanks for advice. For the #2 solution. How do remove the formula by using JSL instead of doing it manually?</description>
      <pubDate>Wed, 19 Aug 2020 09:03:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Rank-Unique/m-p/286676#M55332</guid>
      <dc:creator>OneNorthJMP</dc:creator>
      <dc:date>2020-08-19T09:03:26Z</dc:date>
    </item>
    <item>
      <title>Re: Rank Unique</title>
      <link>https://community.jmp.com/t5/Discussions/Rank-Unique/m-p/286677#M55333</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = current data table();
dt:Rank &amp;lt;&amp;lt; delete formula;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Aug 2020 09:05:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Rank-Unique/m-p/286677#M55333</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-08-19T09:05:30Z</dc:date>
    </item>
    <item>
      <title>Re: Rank Unique</title>
      <link>https://community.jmp.com/t5/Discussions/Rank-Unique/m-p/286679#M55335</link>
      <description>&lt;P&gt;If you want a column formula this should work. Independent of sorting.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Local( {L = Associative Array( :Label ) &amp;lt;&amp;lt; get keys}, Loc( L, :Label ) )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Same approach could be used in JSL without a column formula.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();
dt &amp;lt;&amp;lt; New Column( "Rank Unique", continuous );
L = Associative Array( :Label ) &amp;lt;&amp;lt; get keys;
For Each Row( :Rank Unique = Loc( L, :Label ) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Aug 2020 09:29:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Rank-Unique/m-p/286679#M55335</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2020-08-19T09:29:04Z</dc:date>
    </item>
    <item>
      <title>Re: Rank Unique</title>
      <link>https://community.jmp.com/t5/Discussions/Rank-Unique/m-p/286680#M55336</link>
      <description>&lt;P&gt;Thanks Jim &amp;amp; MS. It work brilliantly!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Aug 2020 09:54:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Rank-Unique/m-p/286680#M55336</guid>
      <dc:creator>OneNorthJMP</dc:creator>
      <dc:date>2020-08-19T09:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: Rank Unique</title>
      <link>https://community.jmp.com/t5/Discussions/Rank-Unique/m-p/886267#M104865</link>
      <description>&lt;P&gt;This is long-since solved, but I found a solution to this yesterday that I figured I'd share in case it's helpful to anyone.&amp;nbsp; Create a new formula column with this formula:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Col Maximum(
	Col Rank(
		If( Row() == Col Minimum( Row(), :Label ),
			:Label,
			.
		)
	),
	:Label
)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Basically this first creates a new array with the label in the row corresponding to its first instance in the original column, and "." everywhere else.&amp;nbsp; Then we ask for the ranking of each label, which results in another array with the label ranking instead of the label itself, and then finally we output an array with the ranking in all rows with that label, and that's what ends up in the formula column.&lt;/P&gt;
&lt;P&gt;In my case I was trying to rank groups of sets of data based on their highest value in another column -- e.g. with columns Group, Set, Time, Value, I wanted to find the set's rank within the group based on the highest Value observed across time.&amp;nbsp; Here's a formula that worked:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Col Maximum(
   Col Rank(
      If ( Row() == Col Minimum( Row(), :Group, :Set),
         Col Maximum( :Value, :Group, :Set ),
         .
         ),
      :Group,&lt;BR /&gt;      &amp;lt;&amp;lt;tie("row")&lt;BR /&gt;      ),
   :Group, :Set
)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I don't know if this is the best way, but it works, and ChatGPT couldn't offer a solution at all, so maybe this will help someone.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jul 2025 16:15:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Rank-Unique/m-p/886267#M104865</guid>
      <dc:creator>BHarris</dc:creator>
      <dc:date>2025-07-10T16:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: Rank Unique</title>
      <link>https://community.jmp.com/t5/Discussions/Rank-Unique/m-p/886302#M104870</link>
      <description>&lt;P&gt;JMP 19:&lt;BR /&gt;&amp;nbsp;&lt;LI-MESSAGE title="Add dense ranking to Ranking Tie and Col Rank functions" uid="590079" url="https://community.jmp.com/t5/JMP-Wish-List/Add-dense-ranking-to-Ranking-Tie-and-Col-Rank-functions/m-p/590079#U590079" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-idea-thread lia-fa-icon lia-fa-idea lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;LI-MESSAGE title="Col N Categories (💚)" uid="592610" url="https://community.jmp.com/t5/JMP-Wish-List/Col-N-Categories/m-p/592610#U592610" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-idea-thread lia-fa-icon lia-fa-idea lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jul 2025 19:47:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Rank-Unique/m-p/886302#M104870</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2025-07-10T19:47:22Z</dc:date>
    </item>
  </channel>
</rss>

