<?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: How can I make JMP to compute a value reflecting the order of a parameter. in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-count-the-rows-by-the-value-in-another-column/m-p/42985#M24925</link>
    <description>&lt;P&gt;If you're using JMP 13, the Col Rank() function support tie breaking by row number, so you get the effect you're looking for.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

dt &amp;lt;&amp;lt; New Column( "Rank within age",
	Formula( Col Rank( 1, :age, &amp;lt;&amp;lt;Tie("row")) ));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The first argument is the value&amp;nbsp;to rank,&amp;nbsp;which is usually another column, but in this case the ranked value doesn't matter so I used the constant, 1.&lt;/P&gt;</description>
    <pubDate>Wed, 09 Aug 2017 14:21:15 GMT</pubDate>
    <dc:creator>XanGregg</dc:creator>
    <dc:date>2017-08-09T14:21:15Z</dc:date>
    <item>
      <title>How to count the rows by the value in another column</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-count-the-rows-by-the-value-in-another-column/m-p/42914#M24885</link>
      <description>&lt;P&gt;I have been using JMP 12.0 for some time and find it fantastic. However, there is a problem where I would appreciate some help since I seem to be the only person who uses JMP wheras the rest uses SPSS.&lt;/P&gt;
&lt;P&gt;I would like to get som information regarding the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;C1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; C2&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Title &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Computed order&lt;/P&gt;
&lt;P&gt;r1 &amp;nbsp; surgeon &amp;nbsp; &amp;nbsp; 1&lt;/P&gt;
&lt;P&gt;r2 &amp;nbsp; surgeon &amp;nbsp; &amp;nbsp; 2&lt;/P&gt;
&lt;P&gt;r3 &amp;nbsp; surgeon &amp;nbsp; &amp;nbsp; 3&lt;/P&gt;
&lt;P&gt;r4 &amp;nbsp; resident &amp;nbsp; &amp;nbsp; 1&lt;/P&gt;
&lt;P&gt;r5 &amp;nbsp; resident &amp;nbsp; &amp;nbsp; 2&lt;/P&gt;
&lt;P&gt;r6 &amp;nbsp; intern &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/P&gt;
&lt;P&gt;r7 &amp;nbsp; intern &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&lt;/P&gt;
&lt;P&gt;etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A friend and collegue of mine uses SPSS and has in that program written the following formula which computes the value in C2 in his SPSS.&lt;/P&gt;
&lt;P&gt;Do if Title&amp;gt;LAG(Title).&lt;/P&gt;
&lt;P&gt;Compute Order=1.&lt;/P&gt;
&lt;P&gt;End if.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Do if Title=LAG(Title).&lt;/P&gt;
&lt;P&gt;Compute Order=LAG(Order)+1.&lt;/P&gt;
&lt;P&gt;End if.&lt;/P&gt;
&lt;P&gt;Execute.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I write a corresponding formula in JMP?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Very greatful if someone could explain how.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;LarsBirger&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Sep 2017 19:34:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-count-the-rows-by-the-value-in-another-column/m-p/42914#M24885</guid>
      <dc:creator>LarsBirger</dc:creator>
      <dc:date>2017-09-20T19:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: How can I make JMP to compute a value reflecting the order of a parameter.</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-count-the-rows-by-the-value-in-another-column/m-p/42923#M24887</link>
      <description>&lt;P&gt;Hi, Lars!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's a script that I think does what you're asking on the Big Class dataset in the Sample Data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

BC_dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

BCSorted_dt = BC_dt &amp;lt;&amp;lt; Sort( By( :age, :sex, :height, :weight ), output table name("Big Class Sorted"));

BCSorted_dt &amp;lt;&amp;lt; New Column( "Computed Order",
	Numeric,
	Ordinal,
	Formula( If(row()==1 | :age!=Lag(:age, 1), 1, Lag(:Computed Order, 1)+1) ),
	EvalFormula);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If all you need is the formula, you can copy the Formula() argument in the script and paste it in the formula editor...just remember to sort the data appropriately first.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Good luck!&lt;/P&gt;</description>
      <pubDate>Tue, 08 Aug 2017 22:10:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-count-the-rows-by-the-value-in-another-column/m-p/42923#M24887</guid>
      <dc:creator>Kevin_Anderson</dc:creator>
      <dc:date>2017-08-08T22:10:23Z</dc:date>
    </item>
    <item>
      <title>Re: How can I make JMP to compute a value reflecting the order of a parameter.</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-count-the-rows-by-the-value-in-another-column/m-p/42985#M24925</link>
      <description>&lt;P&gt;If you're using JMP 13, the Col Rank() function support tie breaking by row number, so you get the effect you're looking for.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

dt &amp;lt;&amp;lt; New Column( "Rank within age",
	Formula( Col Rank( 1, :age, &amp;lt;&amp;lt;Tie("row")) ));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The first argument is the value&amp;nbsp;to rank,&amp;nbsp;which is usually another column, but in this case the ranked value doesn't matter so I used the constant, 1.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2017 14:21:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-count-the-rows-by-the-value-in-another-column/m-p/42985#M24925</guid>
      <dc:creator>XanGregg</dc:creator>
      <dc:date>2017-08-09T14:21:15Z</dc:date>
    </item>
    <item>
      <title>Re: How can I make JMP to compute a value reflecting the order of a parameter.</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-count-the-rows-by-the-value-in-another-column/m-p/43835#M25321</link>
      <description>&lt;P&gt;Thank you for the answers. I will have a look into this. A colleague helped me with his statistical program (SPSS) but I will definitely look into this since I use JMP continously for my research.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sincerely Yours&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lars&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 11:29:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-count-the-rows-by-the-value-in-another-column/m-p/43835#M25321</guid>
      <dc:creator>LarsBirger</dc:creator>
      <dc:date>2017-08-31T11:29:11Z</dc:date>
    </item>
  </channel>
</rss>

