<?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 Random Sample using Slider object in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Random-Sample-using-Slider-object/m-p/1018201#M344822</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333px;"&gt;I'm developing QlikView dashboards for my Internal Audit department and we must have a method by which an auditor can select random samples once they have drilled to a certain population of detail records. The method I've come up with appears to work (sometimes) but the slide bar is rather erratic. I feel pretty certain I can get it to work consistently but I need some assistance. Given the following, I need help with my Slider object and sample selection [Rank() &amp;amp; Rand()] working together consistently. In my example, think of the Strata being sets of data from which we would need to select random samples. Any thoughts would be greatly appreciated. Thanks!&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Here's what I've done so far.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;General Layout using a Slider object to select the sample size.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;IMG alt="Overview.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/117215_Overview.png" /&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Step 1) Create a variable called vSampleSize&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;IMG alt="Create Variable.png" class="jive-image image-2" src="/legacyfs/online/117216_Create Variable.png" /&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Step 2)&amp;nbsp; Use the vSampleSize variable in the Slider Object - General properties.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;IMG alt="Slider Object General.png" class="jive-image image-3" src="/legacyfs/online/117217_Slider Object General.png" /&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Step 3) Assign an action to vSampleSize&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;IMG alt="Variable Action.png" class="image-4 jive-image" src="/legacyfs/online/117218_Variable Action.png" /&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Step 4) Toggle Select Action&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;IMG alt="Toggle Select.png" class="image-5 jive-image" src="/legacyfs/online/117219_Toggle Select.png" /&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Step 5) Build the search string. I want to select the top n (vSampleSize) records randomly assigned using Rank() and Rand()&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;IMG alt="Search String.png" class="jive-image image-6" src="/legacyfs/online/117220_Search String.png" /&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Resulting in a "Toggle Select" selection string like this:&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;IMG alt="Selection String.png" class="jive-image image-7" src="/legacyfs/online/117221_Selection String.png" /&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Why does the selection sometimes do this? It doesn't select.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;IMG alt="Inconsistent.png" class="image-8 jive-image" src="https://community.qlik.com/legacyfs/online/117222_Inconsistent.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 07 Mar 2016 13:40:39 GMT</pubDate>
    <dc:creator>richard_cook</dc:creator>
    <dc:date>2016-03-07T13:40:39Z</dc:date>
    <item>
      <title>Random Sample using Slider object</title>
      <link>https://community.qlik.com/t5/QlikView/Random-Sample-using-Slider-object/m-p/1018201#M344822</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333px;"&gt;I'm developing QlikView dashboards for my Internal Audit department and we must have a method by which an auditor can select random samples once they have drilled to a certain population of detail records. The method I've come up with appears to work (sometimes) but the slide bar is rather erratic. I feel pretty certain I can get it to work consistently but I need some assistance. Given the following, I need help with my Slider object and sample selection [Rank() &amp;amp; Rand()] working together consistently. In my example, think of the Strata being sets of data from which we would need to select random samples. Any thoughts would be greatly appreciated. Thanks!&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Here's what I've done so far.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;General Layout using a Slider object to select the sample size.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;IMG alt="Overview.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/117215_Overview.png" /&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Step 1) Create a variable called vSampleSize&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;IMG alt="Create Variable.png" class="jive-image image-2" src="/legacyfs/online/117216_Create Variable.png" /&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Step 2)&amp;nbsp; Use the vSampleSize variable in the Slider Object - General properties.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;IMG alt="Slider Object General.png" class="jive-image image-3" src="/legacyfs/online/117217_Slider Object General.png" /&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Step 3) Assign an action to vSampleSize&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;IMG alt="Variable Action.png" class="image-4 jive-image" src="/legacyfs/online/117218_Variable Action.png" /&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Step 4) Toggle Select Action&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;IMG alt="Toggle Select.png" class="image-5 jive-image" src="/legacyfs/online/117219_Toggle Select.png" /&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Step 5) Build the search string. I want to select the top n (vSampleSize) records randomly assigned using Rank() and Rand()&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;IMG alt="Search String.png" class="jive-image image-6" src="/legacyfs/online/117220_Search String.png" /&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Resulting in a "Toggle Select" selection string like this:&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;IMG alt="Selection String.png" class="jive-image image-7" src="/legacyfs/online/117221_Selection String.png" /&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Why does the selection sometimes do this? It doesn't select.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;IMG alt="Inconsistent.png" class="image-8 jive-image" src="https://community.qlik.com/legacyfs/online/117222_Inconsistent.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Mar 2016 13:40:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Random-Sample-using-Slider-object/m-p/1018201#M344822</guid>
      <dc:creator>richard_cook</dc:creator>
      <dc:date>2016-03-07T13:40:39Z</dc:date>
    </item>
    <item>
      <title>Re: Random Sample using Slider object</title>
      <link>https://community.qlik.com/t5/QlikView/Random-Sample-using-Slider-object/m-p/1018202#M344823</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Richard,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;unfortunately, I don't have an answer for you.&lt;/P&gt;&lt;P&gt;But I found your post really helpful for something I am trying right now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any chance, you figured out how to make the sample even more random? I noticed that whenever you aks for the same sample size (e.g. 10) you will always get the same 10 samples.&lt;/P&gt;&lt;P&gt;However, I would like to see different samples every time you change the sample size.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would you or anyone else know how to do this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Daniela&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Sep 2016 06:04:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Random-Sample-using-Slider-object/m-p/1018202#M344823</guid>
      <dc:creator />
      <dc:date>2016-09-14T06:04:35Z</dc:date>
    </item>
    <item>
      <title>Re: Random Sample using Slider object</title>
      <link>https://community.qlik.com/t5/QlikView/Random-Sample-using-Slider-object/m-p/1018203#M344824</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Daniela,&lt;/P&gt;&lt;P&gt;In your scenario, the random stays the same until the app is reloaded.&lt;/P&gt;&lt;P&gt;To have it change each time you can multiply your Rand by now().&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Aug 2017 19:18:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Random-Sample-using-Slider-object/m-p/1018203#M344824</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-08-09T19:18:06Z</dc:date>
    </item>
    <item>
      <title>Re: Random Sample using Slider object</title>
      <link>https://community.qlik.com/t5/QlikView/Random-Sample-using-Slider-object/m-p/1018204#M344825</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I know this was a long time ago but I got this to work. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Aug 2017 19:47:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Random-Sample-using-Slider-object/m-p/1018204#M344825</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-08-09T19:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: Random Sample using Slider object</title>
      <link>https://community.qlik.com/t5/QlikView/Random-Sample-using-Slider-object/m-p/1018205#M344826</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank You Wallo! That seems to have solved its erratic behavior and provides the sample selection I was looking for.&amp;nbsp; It was a while ago but the functionality is still fundamental to how we can use leverage QlikView in the future.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Aug 2017 18:55:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Random-Sample-using-Slider-object/m-p/1018205#M344826</guid>
      <dc:creator>richard_cook</dc:creator>
      <dc:date>2017-08-10T18:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: Random Sample using Slider object</title>
      <link>https://community.qlik.com/t5/QlikView/Random-Sample-using-Slider-object/m-p/1018206#M344827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Glad it works.&amp;nbsp; As I mentioned to Daniela, if you want it to select a different random group each time, you'll need to multiply the RAND() by now().&lt;/P&gt;&lt;P&gt;So the vExpression becomes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'=rank(rand()*&lt;STRONG&gt;now()&lt;/STRONG&gt;*100)&amp;lt;($(vSampleSize)+1)'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Otherwise, you'll only get a different random selection when the app is reloaded.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Aug 2017 19:15:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Random-Sample-using-Slider-object/m-p/1018206#M344827</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-08-10T19:15:31Z</dc:date>
    </item>
    <item>
      <title>Re: Random Sample using Slider object</title>
      <link>https://community.qlik.com/t5/QlikView/Random-Sample-using-Slider-object/m-p/1018207#M344828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Which is exactly what I needed! Exactly! That's just perfect!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Aug 2017 19:29:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Random-Sample-using-Slider-object/m-p/1018207#M344828</guid>
      <dc:creator>richard_cook</dc:creator>
      <dc:date>2017-08-10T19:29:04Z</dc:date>
    </item>
    <item>
      <title>Re: Random Sample using Slider object</title>
      <link>https://community.qlik.com/t5/QlikView/Random-Sample-using-Slider-object/m-p/1018208#M344829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Daniela,&lt;/P&gt;&lt;P&gt;Wallo's solution and addendum below perform the functionality both you and I were looking for.&lt;/P&gt;&lt;P&gt;I hope it helps you!&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Ricky&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Aug 2017 19:37:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Random-Sample-using-Slider-object/m-p/1018208#M344829</guid>
      <dc:creator>richard_cook</dc:creator>
      <dc:date>2017-08-10T19:37:51Z</dc:date>
    </item>
  </channel>
</rss>

