<?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 Generating random data for demo in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Generating-random-data-for-demo/m-p/186519#M50574</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Assume previously loaded table OUTLET with a field named "Outlet". Use NoOfRows('OUTLET') as the limit variable. Use peek() as the index.&lt;/P&gt;&lt;P&gt;Suggested code (untested)&lt;/P&gt;&lt;P&gt;FOR i = 0 TO NoOfRows('OUTLET') - 1&lt;BR /&gt; TmpSalesData:&lt;BR /&gt; LOAD&lt;BR /&gt; peek('Outlet', $(i), 'OUTLET') as Outlet,&lt;BR /&gt; Date($(varMinDate) + RowNo() - 1) AS DateKey,&lt;BR /&gt; rand()*3500 + 1500 AS RandomData&lt;BR /&gt; AUTOGENERATE ($(varMaxDate) - $(varMinDate)+1);&lt;BR /&gt;NEXT&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Dec 2009 15:12:41 GMT</pubDate>
    <dc:creator>rwunderlich</dc:creator>
    <dc:date>2009-12-15T15:12:41Z</dc:date>
    <item>
      <title>Generating random data for demo</title>
      <link>https://community.qlik.com/t5/QlikView/Generating-random-data-for-demo/m-p/186518#M50573</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a script that is generating random sales data between 1500 and 5000 for a range of dates as below...&lt;/P&gt;&lt;P&gt;&lt;EM&gt;TmpSalesData:&lt;BR /&gt;LOAD&lt;BR /&gt; Date($(varMinDate) + RowNo() - 1) AS DateKey,&lt;BR /&gt; rand()*3500 + 1500 AS RandomData&lt;BR /&gt; AUTOGENERATE ($(varMaxDate) - $(varMinDate)+1);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;I also have a field called OUTLET in a previously loaded table. I would like to amend my script for the TmpSalesData table using FOR .. NEXT to generate random data for each combination of Date and OUTLET. I have tried a few combinations of FOR .. NEXT within and outside the load statement without success. Could someone please point me in the right direction?&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;P&gt;Dave&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Dec 2009 19:52:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Generating-random-data-for-demo/m-p/186518#M50573</guid>
      <dc:creator />
      <dc:date>2009-12-14T19:52:32Z</dc:date>
    </item>
    <item>
      <title>Generating random data for demo</title>
      <link>https://community.qlik.com/t5/QlikView/Generating-random-data-for-demo/m-p/186519#M50574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Assume previously loaded table OUTLET with a field named "Outlet". Use NoOfRows('OUTLET') as the limit variable. Use peek() as the index.&lt;/P&gt;&lt;P&gt;Suggested code (untested)&lt;/P&gt;&lt;P&gt;FOR i = 0 TO NoOfRows('OUTLET') - 1&lt;BR /&gt; TmpSalesData:&lt;BR /&gt; LOAD&lt;BR /&gt; peek('Outlet', $(i), 'OUTLET') as Outlet,&lt;BR /&gt; Date($(varMinDate) + RowNo() - 1) AS DateKey,&lt;BR /&gt; rand()*3500 + 1500 AS RandomData&lt;BR /&gt; AUTOGENERATE ($(varMaxDate) - $(varMinDate)+1);&lt;BR /&gt;NEXT&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Dec 2009 15:12:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Generating-random-data-for-demo/m-p/186519#M50574</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2009-12-15T15:12:41Z</dc:date>
    </item>
    <item>
      <title>Generating random data for demo</title>
      <link>https://community.qlik.com/t5/QlikView/Generating-random-data-for-demo/m-p/186520#M50575</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many thanks Rob, that is perfect.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Dave&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Dec 2009 19:16:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Generating-random-data-for-demo/m-p/186520#M50575</guid>
      <dc:creator />
      <dc:date>2009-12-15T19:16:23Z</dc:date>
    </item>
  </channel>
</rss>

