<?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 How is Rand calculated how is it seeded? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-is-Rand-calculated-how-is-it-seeded/m-p/1080705#M360126</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am working on a sampling routine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Our statistician wants to know if we can adjust the seed&amp;nbsp; - his words not mine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;His expectation is if I re-load the data in the same order and pick a random row using the same seed then it would yield the same results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure that's going to work but figured I would post in the community to see what everyone has to say.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dan &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 28 Mar 2016 16:50:27 GMT</pubDate>
    <dc:creator>dgreenberg</dc:creator>
    <dc:date>2016-03-28T16:50:27Z</dc:date>
    <item>
      <title>How is Rand calculated how is it seeded?</title>
      <link>https://community.qlik.com/t5/QlikView/How-is-Rand-calculated-how-is-it-seeded/m-p/1080705#M360126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am working on a sampling routine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Our statistician wants to know if we can adjust the seed&amp;nbsp; - his words not mine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;His expectation is if I re-load the data in the same order and pick a random row using the same seed then it would yield the same results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure that's going to work but figured I would post in the community to see what everyone has to say.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dan &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Mar 2016 16:50:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-is-Rand-calculated-how-is-it-seeded/m-p/1080705#M360126</guid>
      <dc:creator>dgreenberg</dc:creator>
      <dc:date>2016-03-28T16:50:27Z</dc:date>
    </item>
    <item>
      <title>Re: How is Rand calculated how is it seeded?</title>
      <link>https://community.qlik.com/t5/QlikView/How-is-Rand-calculated-how-is-it-seeded/m-p/1080706#M360127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have never done it, but tried looking it up on Google and QV's help. From the looks of it, it doesn't seem it is possible, unless there is a work around available.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Mar 2016 16:55:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-is-Rand-calculated-how-is-it-seeded/m-p/1080706#M360127</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-03-28T16:55:36Z</dc:date>
    </item>
    <item>
      <title>Re: How is Rand calculated how is it seeded?</title>
      <link>https://community.qlik.com/t5/QlikView/How-is-Rand-calculated-how-is-it-seeded/m-p/1080707#M360128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can test with the QlikView Test Script and you'll see that with every reload it generates independent random values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the answers for your statistician are :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; No:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; You cannot adjust the seed&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; No:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; It will not yield the same results when reloaded again&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I ain't got clue how rand() actually works under the bonnet though.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Characters:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Load Chr(RecNo()+Ord('A')-1) as Alpha, RecNo() as Num autogenerate 26;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;ASCII:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Load &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; if(RecNo()&amp;gt;=65 and RecNo()&amp;lt;=90,RecNo()-64) as Num,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; Chr(RecNo()) as AsciiAlpha, &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; RecNo() as AsciiNum&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;autogenerate 255&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; Where (RecNo()&amp;gt;=32 and RecNo()&amp;lt;=126) or RecNo()&amp;gt;=160 ;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Transactions:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Load&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; TransLineID, &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; TransID,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; mod(TransID,26)+1 as Num,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; Pick(Ceil(3*Rand1),'A','B','C') as Dim1,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; Pick(Ceil(6*Rand1),'a','b','c','d','e','f') as Dim2,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; Pick(Ceil(3*Rand()),'X','Y','Z') as Dim3,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; Round(1000*Rand()*Rand()*Rand1) as Expression1,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; Round(&amp;nbsp; 10*Rand()*Rand()*Rand1) as Expression2,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; Round(Rand()*Rand1,0.00001) as Expression3;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Load &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; Rand() as Rand1,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; IterNo() as TransLineID,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; RecNo() as TransID&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Autogenerate 1000&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; While Rand()&amp;lt;=0.5 or IterNo()=1;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Mar 2016 17:15:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-is-Rand-calculated-how-is-it-seeded/m-p/1080707#M360128</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-03-28T17:15:55Z</dc:date>
    </item>
    <item>
      <title>Re: How is Rand calculated how is it seeded?</title>
      <link>https://community.qlik.com/t5/QlikView/How-is-Rand-calculated-how-is-it-seeded/m-p/1080708#M360129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That is what I expected just needed some backup to explain to the statistician that we can't do that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Mar 2016 17:17:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-is-Rand-calculated-how-is-it-seeded/m-p/1080708#M360129</guid>
      <dc:creator>dgreenberg</dc:creator>
      <dc:date>2016-03-28T17:17:25Z</dc:date>
    </item>
    <item>
      <title>Re: How is Rand calculated how is it seeded?</title>
      <link>https://community.qlik.com/t5/QlikView/How-is-Rand-calculated-how-is-it-seeded/m-p/1080709#M360130</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, if you need the same sequence of "random" numbers on every reload, you could probably either&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a) use a small VBScript calling RND / Randomize&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;b) create a set of numbers using QV script Rand() function, write this to a QVD and use this file &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Mar 2016 17:24:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-is-Rand-calculated-how-is-it-seeded/m-p/1080709#M360130</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-03-28T17:24:42Z</dc:date>
    </item>
  </channel>
</rss>

