<?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: Which JMP function can generate a non-repeating integer between two values? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Which-JMP-function-can-generate-a-non-repeating-integer-between/m-p/287275#M55455</link>
    <description>&lt;P&gt;And another way:&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 );

random order = Function( { min, max },
	min = Floor( min ); max = Floor( max );
	Index( min, max )[Rank( J( max-min+1, 1, Random Uniform() ) )];
);

Show( random order( 5, 10 ) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 23 Aug 2020 14:58:57 GMT</pubDate>
    <dc:creator>Mark_Bailey</dc:creator>
    <dc:date>2020-08-23T14:58:57Z</dc:date>
    <item>
      <title>Which JMP function can generate a non-repeating integer between two values?</title>
      <link>https://community.jmp.com/t5/Discussions/Which-JMP-function-can-generate-a-non-repeating-integer-between/m-p/287130#M55414</link>
      <description>&lt;P&gt;I tried “Random Integer()”, but it produces duplicate integers. Thanks!&lt;/P&gt;</description>
      <pubDate>Sun, 11 Jun 2023 11:50:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Which-JMP-function-can-generate-a-non-repeating-integer-between/m-p/287130#M55414</guid>
      <dc:creator>lwx228</dc:creator>
      <dc:date>2023-06-11T11:50:02Z</dc:date>
    </item>
    <item>
      <title>Re: Which JMP function can generate a non-repeating integer between two values?</title>
      <link>https://community.jmp.com/t5/Discussions/Which-JMP-function-can-generate-a-non-repeating-integer-between/m-p/287145#M55417</link>
      <description>&lt;P&gt;I do not believe there is such a function in JMP, but it is very simple to create one&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

uniqueRandomInteger = Function( {n, min, max},
	{defaultlocal},
	hold = [];
	For( i = 1, i &amp;lt;= n, i++,
		val = Random Integer( min, max );
		While( N Rows( Loc( hold, val ) ) &amp;gt; 0,
			val = Random Integer( min, max )
		);
		hold = hold |/ Matrix( val );
	);
	hold;
);

x=uniqueRandomInteger(10,100,200)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 21 Aug 2020 15:42:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Which-JMP-function-can-generate-a-non-repeating-integer-between/m-p/287145#M55417</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-08-21T15:42:58Z</dc:date>
    </item>
    <item>
      <title>Re: Which JMP function can generate a non-repeating integer between two values?</title>
      <link>https://community.jmp.com/t5/Discussions/Which-JMP-function-can-generate-a-non-repeating-integer-between/m-p/287187#M55427</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/12538"&gt;@lwx228&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is just an alternate method relying on the JMP function Random Shuffle&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here(1);

ibeg = 257;

iend = 500;

random_all = As List( Random Shuffle( Transpose(ibeg::iend) ) );

//suppose you only want 100

vals = random_all[1::100];

show(random_all, nitems(random_all), iend-ibeg+1 );

show(vals, nitems(vals));
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I felt like a slacker, given Jim's elegant function. [grin] The attached script includes a function that uses this range/shuffle/subset&amp;nbsp; method.&amp;nbsp; Jim,&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;,&amp;nbsp; your function name was spot on, so I used it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;'&lt;/SPAN&gt;&lt;EM&gt;Imitation&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;is the sincerest form of&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;flattery&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;that mediocrity can pay to greatness.' - Oscar Wilde&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Aug 2020 18:26:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Which-JMP-function-can-generate-a-non-repeating-integer-between/m-p/287187#M55427</guid>
      <dc:creator>gzmorgan0</dc:creator>
      <dc:date>2020-08-21T18:26:03Z</dc:date>
    </item>
    <item>
      <title>Re: Which JMP function can generate a non-repeating integer between two values?</title>
      <link>https://community.jmp.com/t5/Discussions/Which-JMP-function-can-generate-a-non-repeating-integer-between/m-p/287275#M55455</link>
      <description>&lt;P&gt;And another way:&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 );

random order = Function( { min, max },
	min = Floor( min ); max = Floor( max );
	Index( min, max )[Rank( J( max-min+1, 1, Random Uniform() ) )];
);

Show( random order( 5, 10 ) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 23 Aug 2020 14:58:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Which-JMP-function-can-generate-a-non-repeating-integer-between/m-p/287275#M55455</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2020-08-23T14:58:57Z</dc:date>
    </item>
  </channel>
</rss>

