<?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: Dislpaying Random Tips in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Dislpaying-Random-Tips/m-p/779112#M276149</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nice Marco! I'll have to try that in the ajax client though since I've had issues with the OnOpen trigger not working.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Dec 2014 21:50:26 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2014-12-04T21:50:26Z</dc:date>
    <item>
      <title>Dislpaying Random Tips</title>
      <link>https://community.qlik.com/t5/QlikView/Dislpaying-Random-Tips/m-p/779106#M276143</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is a fun little object I'm trying to implement into my template .qvw but I need a little help figuring something out. I have a simple spreadsheet that I am loading as a data island that contains small, simple tips for users. It's only two columns: a Tip_ID (integer starting at 1) and Tip_Text (usually no more than about 200 characters). Right now I have about 20 records but this will grow over time.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;I want to display a text box on the opening sheet that displays a random tip from this loaded data. The tip displayed will change, randomly, every time the app opens. I'm also thinking of adding a button that the user can click on to display a new random tip (generate a new random number), just in case the the user wants to view other tips. But this latter feature is not required. The function for randomly choosing which tip to display needs to work between 1 and the max of the rows loaded from this spreadsheet. This app is ajax only, so a macro isn't a option. &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Any ideas?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Dec 2014 19:19:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dislpaying-Random-Tips/m-p/779106#M276143</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-12-04T19:19:59Z</dc:date>
    </item>
    <item>
      <title>Re: Dislpaying Random Tips</title>
      <link>https://community.qlik.com/t5/QlikView/Dislpaying-Random-Tips/m-p/779107#M276144</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can generate a random number between 1 and x (where x is the number of records in your tip table) by doing the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;floor(rand()*X+1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To improve upon this, you could create a variable named say vNum. Create a button with an action to set the value of vNum equal to rand(), then use this equation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;floor(vNum*X+1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then put this into a textbox:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concat({&amp;lt;tip_id = {$(=floor(vNum*X+1)}&amp;gt;} tiptext)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Dec 2014 19:26:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dislpaying-Random-Tips/m-p/779107#M276144</guid>
      <dc:creator />
      <dc:date>2014-12-04T19:26:40Z</dc:date>
    </item>
    <item>
      <title>Re: Dislpaying Random Tips</title>
      <link>https://community.qlik.com/t5/QlikView/Dislpaying-Random-Tips/m-p/779108#M276145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe an on open trigger selecting a value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ceil(Rand()*Max({1} Tip_ID))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then just displaying a text box with the actual tip text should do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Dec 2014 19:44:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dislpaying-Random-Tips/m-p/779108#M276145</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2014-12-04T19:44:33Z</dc:date>
    </item>
    <item>
      <title>Re: Dislpaying Random Tips</title>
      <link>https://community.qlik.com/t5/QlikView/Dislpaying-Random-Tips/m-p/779109#M276146</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually, this seems to have worked:  =Ceil(rand()*Max(Tip_ID))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unless there is mathimatical flaw with that method that I don’t see.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-           Brian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Dec 2014 19:44:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dislpaying-Random-Tips/m-p/779109#M276146</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-12-04T19:44:53Z</dc:date>
    </item>
    <item>
      <title>Re: Dislpaying Random Tips</title>
      <link>https://community.qlik.com/t5/QlikView/Dislpaying-Random-Tips/m-p/779110#M276147</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the input guys. This seems to be working:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vRandomTip: =Ceil(rand()*Max(Tip_ID))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;List Box Expression: =If(Tip_ID=$(vRandomTip),[Tip Text])&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Dec 2014 19:53:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dislpaying-Random-Tips/m-p/779110#M276147</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-12-04T19:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Dislpaying Random Tips</title>
      <link>https://community.qlik.com/t5/QlikView/Dislpaying-Random-Tips/m-p/779111#M276148</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG alt="QlikCommunity_Thread_144705_Pic1.JPG.jpg" class="jive-image" src="https://community.qlik.com/legacyfs/online/72783_QlikCommunity_Thread_144705_Pic1.JPG.jpg" style="width: 620px; height: 257px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="QlikCommunity_Thread_144705_Pic2.JPG.jpg" class="jive-image" src="https://community.qlik.com/legacyfs/online/72784_QlikCommunity_Thread_144705_Pic2.JPG.jpg" style="width: 620px; height: 436px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Dec 2014 21:46:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dislpaying-Random-Tips/m-p/779111#M276148</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2014-12-04T21:46:57Z</dc:date>
    </item>
    <item>
      <title>Re: Dislpaying Random Tips</title>
      <link>https://community.qlik.com/t5/QlikView/Dislpaying-Random-Tips/m-p/779112#M276149</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nice Marco! I'll have to try that in the ajax client though since I've had issues with the OnOpen trigger not working.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Dec 2014 21:50:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dislpaying-Random-Tips/m-p/779112#M276149</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-12-04T21:50:26Z</dc:date>
    </item>
  </channel>
</rss>

