<?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: Help with Random Selection in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Help-with-Random-Selection/m-p/395357#M1167745</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Then I guess, you need &lt;SPAN style="text-decoration: line-through;"&gt;FieldValue&lt;/SPAN&gt;, NoOf&lt;SPAN style="text-decoration: line-through;"&gt;Fields&lt;/SPAN&gt;Rows, Ceil/Foor and maybe &lt;SPAN style="text-decoration: line-through;"&gt;LookUp&lt;/SPAN&gt;Peek functions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Sep 2012 13:55:39 GMT</pubDate>
    <dc:creator>whiteline</dc:creator>
    <dc:date>2012-09-11T13:55:39Z</dc:date>
    <item>
      <title>Help with Random Selection</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-Random-Selection/m-p/395356#M1167744</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I please need help with selecting random accounts that match certain criteria.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Scenario:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Out of about a million accounts, we do Statement checks once a month to ensure the statements are correct for all the different scenarios. We also have 12 different Account Types (companies), and we will do one account per scenario for each of the companies.&lt;/P&gt;&lt;P&gt;There are about 40 different scenarios, for instance, we will select one account percompany that has a D Block Code. Or one account per company that opened in the last month. Currently we make the selections manually (they do this out of different excel files), and then randomly select accounts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So what I would love is to add this to my QlikView module:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A table box or chart that randomly selects one account per scenario, per company (please see the attached image).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas? I know the RAND() function will be involved, but so far I haven't been able to figure it out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gerhard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Sep 2012 13:17:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-Random-Selection/m-p/395356#M1167744</guid>
      <dc:creator>gerhardl</dc:creator>
      <dc:date>2012-09-11T13:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Random Selection</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-Random-Selection/m-p/395357#M1167745</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Then I guess, you need &lt;SPAN style="text-decoration: line-through;"&gt;FieldValue&lt;/SPAN&gt;, NoOf&lt;SPAN style="text-decoration: line-through;"&gt;Fields&lt;/SPAN&gt;Rows, Ceil/Foor and maybe &lt;SPAN style="text-decoration: line-through;"&gt;LookUp&lt;/SPAN&gt;Peek functions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Sep 2012 13:55:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-Random-Selection/m-p/395357#M1167745</guid>
      <dc:creator>whiteline</dc:creator>
      <dc:date>2012-09-11T13:55:39Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Random Selection</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-Random-Selection/m-p/395358#M1167746</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi whiteline,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you maybe give some more detail - I have never used any of those functions. I'll read up on them in the mean time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is one example of what I need:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Show one random [Account No] with [Company] as dimension, where the [Account Status]='Active'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Sep 2012 13:59:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-Random-Selection/m-p/395358#M1167746</guid>
      <dc:creator>gerhardl</dc:creator>
      <dc:date>2012-09-11T13:59:56Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Random Selection</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-Random-Selection/m-p/395359#M1167747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'v made some reasearch.&lt;/P&gt;&lt;P&gt;The easiest way to do it is in load script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Consider that you have an input table from where you want randomly select one row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET RandomRow = Ceil(Rand()*NoOfRows('InputTable'))+1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek('KeyFieldFromInputTable', $(RandomRow), 'InputTable') as KeyField;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek('Field1FromInputTable', $(RandomRow), 'InputTable') as RandomField1; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek('Field2FromInputTable', $(RandomRow), 'InputTable') as RandomField2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;AUTOGENERATE (1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;KeyField you can use to connect your random table with the rest of data model,&lt;/P&gt;&lt;P&gt;so you don't have to copy every field only that you'll use as dimension.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Sep 2012 15:31:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-Random-Selection/m-p/395359#M1167747</guid>
      <dc:creator>whiteline</dc:creator>
      <dc:date>2012-09-11T15:31:17Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Random Selection</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-Random-Selection/m-p/395360#M1167748</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the trouble in helping me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is very new to me so I'm trying to take it step by step - having some trouble with the load.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I added to the top:&lt;/P&gt;&lt;P&gt;&lt;EM style="color: #636363; font-size: 12px; background-color: #ffffff; font-family: Arial;"&gt;&lt;STRONG&gt;LET RandomRow = Ceil(Rand()*NoOfRows('InputTable'))+1;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;Then I load my Account_Extract table (I load multiple other tables as well, but they are not relevant to what I want to do here).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;Please see my image and have a look at what I am doing wrong.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;When I load I get the error:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Error in expression:&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;')' expected&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Random_Table:&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek('Account no', , 'Account_Extract') as KeyField&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;AUTOGENERATE (1)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Sep 2012 09:45:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-Random-Selection/m-p/395360#M1167748</guid>
      <dc:creator>gerhardl</dc:creator>
      <dc:date>2012-09-12T09:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Random Selection</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-Random-Selection/m-p/395361#M1167749</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First, you can't load random row &lt;STRONG&gt;before &lt;/STRONG&gt;you load your data (the NoOfRows function returns null and therefore error).&lt;/P&gt;&lt;P&gt;Add all strings &lt;STRONG&gt;after&lt;/STRONG&gt; loading&amp;nbsp; Account_Extract table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Second, correct the random expression:&lt;/P&gt;&lt;P&gt;LET RandomRow = &lt;SPAN style="text-decoration: line-through;"&gt;round&lt;/SPAN&gt;floor(Rand()*(NoOfRows(Account_Extract)));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and correct peek expression (there should be 2 fields acctually):&lt;/P&gt;&lt;P&gt;Peek('Account no', , 'Account_Extract') as &lt;SPAN style="text-decoration: line-through;"&gt;KeyField&lt;/SPAN&gt; [Account no],&lt;/P&gt;&lt;P&gt;Peek('Account no', , 'Account_Extract') as [Random account no]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;otherwise it lose connection with Account_Extract table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then use&amp;nbsp; [Random account no] just as dimension in your charts.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Sep 2012 10:10:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-Random-Selection/m-p/395361#M1167749</guid>
      <dc:creator>whiteline</dc:creator>
      <dc:date>2012-09-12T10:10:49Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Random Selection</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-Random-Selection/m-p/395362#M1167750</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay, getting closer (although I still have no idea how the chart will work... but one step at a time).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LET RandomRow = round(Rand()*(NoOfRows(Account_Extract)));&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Account_Extract:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;LOAD Field1, &lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Field1, &lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Account no] as [Account No],&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;/EM&gt; //I must change to Accont No -this is a key field used in later tables.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; etc&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;FROM [....]&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;WHERE (...);&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Random_Table:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek('Account no'$(RandomRow) , 'Account_Extract') as [Account no],&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek('Account no'$(RandomRow) , 'Account_Extract') as [Random account no]&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;AUTOGENERATE (1);&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It then loads fine - but when I create a list box of [Random account no] it is empty.&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Sep 2012 10:40:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-Random-Selection/m-p/395362#M1167750</guid>
      <dc:creator>gerhardl</dc:creator>
      <dc:date>2012-09-12T10:40:16Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Random Selection</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-Random-Selection/m-p/395363#M1167751</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;//I must change to Accont No -this is a key field used in later tables.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Why didn't you change it in peek also ?&lt;/P&gt;&lt;P&gt;Peek('Account no', $(RandomRow) , 'Account_Extract') as [Account &lt;SPAN style="color: #ff0000;"&gt;N&lt;/SPAN&gt;o],&lt;/P&gt;&lt;P&gt;The purpose of that field is the same - key field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You also missed the ',' in peek (look at help to get better understanding of what you're doing):&lt;/P&gt;&lt;P&gt;Peek('Account no'&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;,&lt;/STRONG&gt;&lt;/SPAN&gt; $(RandomRow) , 'Account_Extract') as [Account &lt;SPAN style="color: #ff0000;"&gt;N&lt;/SPAN&gt;o],&lt;/P&gt;&lt;P&gt;Peek('Account no'&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;,&lt;/STRONG&gt;&lt;/SPAN&gt; $(RandomRow) , 'Account_Extract') as [Random account no]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As for chart. Use [Random account no] as a dimension and you will get only this randomly selected data.&lt;/P&gt;&lt;P&gt;I guess, its only an account name, so you can add another fields in this random table with the same approach (peek()).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Sep 2012 16:50:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-Random-Selection/m-p/395363#M1167751</guid>
      <dc:creator>whiteline</dc:creator>
      <dc:date>2012-09-12T16:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Random Selection</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-Random-Selection/m-p/395364#M1167752</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I did have the comma there originally, but when loading I get the attached error message (Error in Expression.jpg). When I remove the comma it loads correctly (&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;Script Execution.jpg&lt;/SPAN&gt;). From RANDOM TABLE it says "1 lines fetched" - but when I create list boxes I still have no account in the Random Field. Also, under Account No (my key field), right at the bottom where it shows the number of records, it shows "0+12355", which I have never seen before (List Boxes.jpg).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Sep 2012 09:51:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-Random-Selection/m-p/395364#M1167752</guid>
      <dc:creator>gerhardl</dc:creator>
      <dc:date>2012-09-17T09:51:37Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Random Selection</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-Random-Selection/m-p/395365#M1167753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The error message says clearly that RandomRow has null value.&lt;/P&gt;&lt;P&gt;Add quotes:&lt;/P&gt;&lt;P&gt;LET RandomRow = floor(Rand()*(NoOfRows(&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;'&lt;/STRONG&gt;&lt;/SPAN&gt;Account_Extract&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;'&lt;/STRONG&gt;&lt;/SPAN&gt;)));&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Sep 2012 10:44:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-Random-Selection/m-p/395365#M1167753</guid>
      <dc:creator>whiteline</dc:creator>
      <dc:date>2012-09-17T10:44:10Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Random Selection</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-Random-Selection/m-p/395366#M1167754</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure where this error message is that says that clearly - the only error message I get is the one that says "Error in Expression: ')' Expected" - that is fixed when I remove the comma, as I mentioned earlier.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I added the quotes to the LET statement and it made no difference - exact same result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This gives me the error message during the load:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Random_Table:&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Peek('Account no', $(RandomRow) , 'Account_Extract') as [Account No],&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Peek('Account no', $(RandomRow) , 'Account_Extract') as [Random account no]&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;AUTOGENERATE (1);&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I remove the comma after 'Account no' it loads with no problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry - I am really trying to follow your instructions to the letter here.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Sep 2012 10:52:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-Random-Selection/m-p/395366#M1167754</guid>
      <dc:creator>gerhardl</dc:creator>
      <dc:date>2012-09-17T10:52:01Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Random Selection</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-Random-Selection/m-p/395367#M1167755</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay I think I found my mistake - will check if I can figure it out and reply a bit later.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for all the help so far.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Sep 2012 11:00:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-Random-Selection/m-p/395367#M1167755</guid>
      <dc:creator>gerhardl</dc:creator>
      <dc:date>2012-09-17T11:00:51Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Random Selection</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-Random-Selection/m-p/395368#M1167756</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay I've now managed to load one random account number using the load script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now my problem is that I have different scenarios, and for each of them I need different random account numbers, per company.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So let's say I have 10,000 accounts. I randomly want to select one account WHERE the Account Status is "Active", and I want to do that for each company. Then I randomly want to select one account for each company where the Account Status is "Dormant". All of these other fields, which I would use in the expression, is also on the Account_Extract table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At the moment the Random Account gets chosen from the entire Account_Extract table - regardless of the Account Status or anything else. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eventually I am actually going to need maybe 50 or 100 account numbers that are selected randomly AFTER the scenario's rules are applied.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I don;t know if this can all be done using the load? Maybe if I have multiple RANDOM_tables (for each scenario), and then I do sometyhing like LOAD a random account FROM the Account_Extract table, WHERE field X is equal to Y, etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But not sure if that is possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If this is all too hard to accomplish I will ahve to figure out something else - I don;t want to waste any more of your time if we can't do this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Sep 2012 11:29:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-Random-Selection/m-p/395368#M1167756</guid>
      <dc:creator>gerhardl</dc:creator>
      <dc:date>2012-09-17T11:29:57Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Random Selection</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-Random-Selection/m-p/395369#M1167757</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can handle all your tasks with the same approach:&lt;/P&gt;&lt;P&gt;"Use peek with random index to select random field value. Use shared key field to connect it to your data."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You don't have to use variable for each random selection (just substitute the expression).&lt;/P&gt;&lt;P&gt;Just prepeare the field with list of values according to your criteria and then use peek to get one random value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Sep 2012 14:13:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-Random-Selection/m-p/395369#M1167757</guid>
      <dc:creator>whiteline</dc:creator>
      <dc:date>2012-09-17T14:13:18Z</dc:date>
    </item>
  </channel>
</rss>

