<?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: Change the connection script using a macro - newbie question in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Change-the-connection-script-using-a-macro-newbie-question/m-p/724298#M1062454</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;2M rows are for qv rather small datasets and you need not big machines to handle it. Your database and network is more likely the bottleneck. But it's not very senseful to load every time all data into qv. Here you could use a method called incremental load - have a look here:&amp;nbsp; &lt;A _jive_internal="true" class="loading" href="https://community.qlik.com/docs/DOC-4597" title="http://community.qlik.com/docs/DOC-4597"&gt;http://community.qlik.com/docs/DOC-4597&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 Sep 2014 13:45:41 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2014-09-18T13:45:41Z</dc:date>
    <item>
      <title>Change the connection script using a macro - newbie question</title>
      <link>https://community.qlik.com/t5/QlikView/Change-the-connection-script-using-a-macro-newbie-question/m-p/724294#M1062449</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry for this, but I have been searching the threads for hours with little results.&amp;nbsp; I am a newbie trying to sell the product to my organization, so I am using personal edition to build a demo. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a MSSQL data source where there are multiple views.&amp;nbsp; I would like to be able to edit my connection script FROM statement and reload using a series of buttons.&amp;nbsp; My assumption is that multiple macros are necessary, but I am unable to figure out how to change the view from a macro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The connect script is simple:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ODBC CONNECT TO &lt;EM&gt;&lt;STRONG&gt;SERVERNAME&lt;/STRONG&gt;&lt;/EM&gt;;&lt;/P&gt;&lt;P&gt;SQL SELECT *&lt;/P&gt;&lt;P&gt;FROM &lt;EM&gt;&lt;STRONG&gt;DATABASE&lt;/STRONG&gt;&lt;/EM&gt;.dbo."&lt;EM&gt;&lt;STRONG&gt;VIEW1&lt;/STRONG&gt;&lt;/EM&gt;";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want a button that changes whatever the view is (&lt;EM&gt;&lt;STRONG&gt;VIEW1&lt;/STRONG&gt;&lt;/EM&gt;)&lt;EM&gt; &lt;/EM&gt;to&lt;EM&gt;&lt;STRONG&gt; VIEW2&lt;/STRONG&gt;&lt;/EM&gt; or&lt;EM&gt; &lt;STRONG&gt;VIEW3&lt;/STRONG&gt;&lt;/EM&gt;, etc. and then reload the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is greatly appreciated!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Sep 2014 20:54:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Change-the-connection-script-using-a-macro-newbie-question/m-p/724294#M1062449</guid>
      <dc:creator />
      <dc:date>2014-09-17T20:54:51Z</dc:date>
    </item>
    <item>
      <title>Re: Change the connection script using a macro - newbie question</title>
      <link>https://community.qlik.com/t5/QlikView/Change-the-connection-script-using-a-macro-newbie-question/m-p/724295#M1062451</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think it can be achieved using a variable, haven't tried though.&lt;/P&gt;&lt;P&gt;Check out this link&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/message/287213"&gt;Re: Reload Data based on a selected value&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Sep 2014 21:03:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Change-the-connection-script-using-a-macro-newbie-question/m-p/724295#M1062451</guid>
      <dc:creator />
      <dc:date>2014-09-17T21:03:49Z</dc:date>
    </item>
    <item>
      <title>Re: Change the connection script using a macro - newbie question</title>
      <link>https://community.qlik.com/t5/QlikView/Change-the-connection-script-using-a-macro-newbie-question/m-p/724296#M1062452</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could change the connection and/or databases/views per variables within for / for each loops directly in script. Even further conditions could be applied with integrated if-loops. Here a small example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for each servername in 'server1', 'server2'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ODBC CONNECT TO $(servername);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for each view in 'view1', 'view2', 'view3'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SQL SELECT *&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM &lt;EM&gt;&lt;STRONG&gt;DATABASE&lt;/STRONG&gt;&lt;/EM&gt;.dbo.$(view);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; next&lt;/P&gt;&lt;P&gt;next&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could also load your server and views in table and runs then per loop through these table. If possible you should avoid any macros.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Sep 2014 06:30:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Change-the-connection-script-using-a-macro-newbie-question/m-p/724296#M1062452</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2014-09-18T06:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: Change the connection script using a macro - newbie question</title>
      <link>https://community.qlik.com/t5/QlikView/Change-the-connection-script-using-a-macro-newbie-question/m-p/724297#M1062453</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you both so much!&amp;nbsp; I wasn't sure if variables would work in the load script, and my lack of experience with the product is somewhat evident.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As further detail, the reason I did not load the entire dataset is that I was concerned about performance.&amp;nbsp; My table is 1.5M rows and the views are not mutually exclusive meaning that if I load all of the views I could be looking at well over 2M rows.&amp;nbsp; Additionally, this table grows by about 350K each month.&amp;nbsp; I thought it better to let the SQL server do most of the work that rely on my personal edition of QV for testing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another note to Marcus - there is an option to set the variable directly through the button as opposed to a macro.&amp;nbsp; I am assuming that this option is much better than a macro from your recommendation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks again, and I hope this post is helpful for other newbies.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Sep 2014 12:56:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Change-the-connection-script-using-a-macro-newbie-question/m-p/724297#M1062453</guid>
      <dc:creator />
      <dc:date>2014-09-18T12:56:26Z</dc:date>
    </item>
    <item>
      <title>Re: Change the connection script using a macro - newbie question</title>
      <link>https://community.qlik.com/t5/QlikView/Change-the-connection-script-using-a-macro-newbie-question/m-p/724298#M1062454</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;2M rows are for qv rather small datasets and you need not big machines to handle it. Your database and network is more likely the bottleneck. But it's not very senseful to load every time all data into qv. Here you could use a method called incremental load - have a look here:&amp;nbsp; &lt;A _jive_internal="true" class="loading" href="https://community.qlik.com/docs/DOC-4597" title="http://community.qlik.com/docs/DOC-4597"&gt;http://community.qlik.com/docs/DOC-4597&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Sep 2014 13:45:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Change-the-connection-script-using-a-macro-newbie-question/m-p/724298#M1062454</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2014-09-18T13:45:41Z</dc:date>
    </item>
    <item>
      <title>Re: Change the connection script using a macro - newbie question</title>
      <link>https://community.qlik.com/t5/QlikView/Change-the-connection-script-using-a-macro-newbie-question/m-p/724299#M1062455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not quite at that level yet.&amp;nbsp; If/when I get approval for the project and there is an actual server available, then I can look into the more technical side of performance.&amp;nbsp; Still, it is encouraging that the database size will not be a problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you again for your feedback and the variable solution did work for now.&amp;nbsp; I am ready to present to the committee and it should go well.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Sep 2014 17:24:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Change-the-connection-script-using-a-macro-newbie-question/m-p/724299#M1062455</guid>
      <dc:creator />
      <dc:date>2014-09-18T17:24:06Z</dc:date>
    </item>
  </channel>
</rss>

