<?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: Rand Function in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Rand-Function/m-p/736480#M1072672</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I suppose you can do something like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mapNumbers:&lt;/P&gt;&lt;P&gt;mapping load * inline [&lt;/P&gt;&lt;P&gt;ID, Number&lt;/P&gt;&lt;P&gt;1, 3333&lt;/P&gt;&lt;P&gt;2, 5555&lt;/P&gt;&lt;P&gt;3, 1337&lt;/P&gt;&lt;P&gt;4, 5433&lt;/P&gt;&lt;P&gt;5, 11&lt;/P&gt;&lt;P&gt;6, 5432&lt;/P&gt;&lt;P&gt;7, 1223&lt;/P&gt;&lt;P&gt;8, 332&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let vNoOfNumbers = NoOfRows('MapNumbers');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fact:&lt;/P&gt;&lt;P&gt;load &lt;BR /&gt;applymap('mapNumbers',ceil(rand()*'$(vNoOfNumbers)'),null()) as RandomSelectedNumber&lt;/P&gt;&lt;P&gt;From&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;If you want to read the possible numbers from a file you would do:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mapNumbers:&lt;/P&gt;&lt;P&gt;mapping load rowno() as ID, Number from File.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 08 Aug 2014 00:35:30 GMT</pubDate>
    <dc:creator>simenkg</dc:creator>
    <dc:date>2014-08-08T00:35:30Z</dc:date>
    <item>
      <title>Rand Function</title>
      <link>https://community.qlik.com/t5/QlikView/Rand-Function/m-p/736478#M1072670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, experts, i would like to know if there is a way to use the rand function but i pass the posible value, not only 1 or 0 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i want to create random data but i provide the possible numbers, only create rando using that list of numbers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you a lot&lt;/P&gt;&lt;P&gt;Fernando&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Aug 2014 00:22:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rand-Function/m-p/736478#M1072670</guid>
      <dc:creator>fkeuroglian</dc:creator>
      <dc:date>2014-08-08T00:22:23Z</dc:date>
    </item>
    <item>
      <title>Re: Rand Function</title>
      <link>https://community.qlik.com/t5/QlikView/Rand-Function/m-p/736479#M1072671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rand() only returns a numbers between 0 and 1. You can use the result of rand to select from a list of numbers using various arithmetic and rounding operations. Some examples:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=ceil(rand()*1000,100)&amp;nbsp;&amp;nbsp; // Generate a number between 100 and 1000 in multiples of 100&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=pick(ceil(rand()*5), '12', '15', '27', '3', '44')&amp;nbsp;&amp;nbsp; // Picks randomly from these 5 values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Aug 2014 00:32:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rand-Function/m-p/736479#M1072671</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2014-08-08T00:32:37Z</dc:date>
    </item>
    <item>
      <title>Re: Rand Function</title>
      <link>https://community.qlik.com/t5/QlikView/Rand-Function/m-p/736480#M1072672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I suppose you can do something like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mapNumbers:&lt;/P&gt;&lt;P&gt;mapping load * inline [&lt;/P&gt;&lt;P&gt;ID, Number&lt;/P&gt;&lt;P&gt;1, 3333&lt;/P&gt;&lt;P&gt;2, 5555&lt;/P&gt;&lt;P&gt;3, 1337&lt;/P&gt;&lt;P&gt;4, 5433&lt;/P&gt;&lt;P&gt;5, 11&lt;/P&gt;&lt;P&gt;6, 5432&lt;/P&gt;&lt;P&gt;7, 1223&lt;/P&gt;&lt;P&gt;8, 332&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let vNoOfNumbers = NoOfRows('MapNumbers');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fact:&lt;/P&gt;&lt;P&gt;load &lt;BR /&gt;applymap('mapNumbers',ceil(rand()*'$(vNoOfNumbers)'),null()) as RandomSelectedNumber&lt;/P&gt;&lt;P&gt;From&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;If you want to read the possible numbers from a file you would do:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mapNumbers:&lt;/P&gt;&lt;P&gt;mapping load rowno() as ID, Number from File.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Aug 2014 00:35:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rand-Function/m-p/736480#M1072672</guid>
      <dc:creator>simenkg</dc:creator>
      <dc:date>2014-08-08T00:35:30Z</dc:date>
    </item>
  </channel>
</rss>

