<?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 Connections with more than one databases in the same document in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Connections-with-more-than-one-databases-in-the-same-document/m-p/318251#M706432</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I've an Oracle db with 2 differnt schemas 'sh' and 'oe'. I use this code to connect to the 2 different schemas and load data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ODBC CONNECT TO [orcl-rh;DBQ=ORCL ] (XUserId is XIKIAUJOeA, XPassword is NZRWAUJOZC);&lt;/P&gt;&lt;P&gt;LOAD "EMPLOYEE_ID",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "FIRST_NAME",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "LAST_NAME",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; EMAIL,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "PHONE_NUMBER",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "HIRE_DATE",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "JOB_ID",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SALARY,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "COMMISSION_PCT",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "MANAGER_ID",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "DEPARTMENT_ID";&lt;/P&gt;&lt;P&gt;SQL SELECT *&lt;/P&gt;&lt;P&gt;FROM HR.EMPLOYEES;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ODBC CONNECT TO [orcl-sh;DBQ=ORCL ] (XUserId is bBUAXZBNWG, XPassword is ZVbbVZBNfG);&lt;/P&gt;&lt;P&gt;LOAD "CHANNEL_ID",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "CHANNEL_DESC",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "CHANNEL_CLASS",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "CHANNEL_CLASS_ID",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "CHANNEL_TOTAL",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "CHANNEL_TOTAL_ID";&lt;/P&gt;&lt;P&gt;SQL SELECT *&lt;/P&gt;&lt;P&gt;FROM SH.CHANNELS;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think the same idea would work for your databases.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards, Ferran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Jan 2012 18:01:10 GMT</pubDate>
    <dc:creator>Ferran_Garcia_Pagans</dc:creator>
    <dc:date>2012-01-30T18:01:10Z</dc:date>
    <item>
      <title>Connections with more than one databases in the same document</title>
      <link>https://community.qlik.com/t5/QlikView/Connections-with-more-than-one-databases-in-the-same-document/m-p/318250#M706431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am creating a qlikview document which presents inventory, sales, and other aspects of our 42 stores. The data for the stores are stored in servers which uses postgresql. we have two servers storing&amp;nbsp; 20 of the 42 stores in one sever and the other 22 are stored on the other server. structurally the database of all the stores are identical (same schemas and tables). I have created two DSNs for the two servers for an ODBC connection. I have been able to load the tables from one of the servers and create few tables and charts. It works fine. However, now I want to connect all the stores(from both the servers) to that document so that I can browse through the inventory or sales of any store from the same document. &lt;/P&gt;&lt;P&gt;Is it possible? &lt;/P&gt;&lt;P&gt;How do I arange my script to be able to do that? when I created two connections it only considers latest connection to pull the tables from the database.&lt;/P&gt;&lt;P&gt;Please, give some ideas or direct me to relavent documents or forum.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jan 2012 17:49:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Connections-with-more-than-one-databases-in-the-same-document/m-p/318250#M706431</guid>
      <dc:creator />
      <dc:date>2012-01-30T17:49:05Z</dc:date>
    </item>
    <item>
      <title>Connections with more than one databases in the same document</title>
      <link>https://community.qlik.com/t5/QlikView/Connections-with-more-than-one-databases-in-the-same-document/m-p/318251#M706432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I've an Oracle db with 2 differnt schemas 'sh' and 'oe'. I use this code to connect to the 2 different schemas and load data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ODBC CONNECT TO [orcl-rh;DBQ=ORCL ] (XUserId is XIKIAUJOeA, XPassword is NZRWAUJOZC);&lt;/P&gt;&lt;P&gt;LOAD "EMPLOYEE_ID",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "FIRST_NAME",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "LAST_NAME",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; EMAIL,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "PHONE_NUMBER",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "HIRE_DATE",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "JOB_ID",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SALARY,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "COMMISSION_PCT",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "MANAGER_ID",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "DEPARTMENT_ID";&lt;/P&gt;&lt;P&gt;SQL SELECT *&lt;/P&gt;&lt;P&gt;FROM HR.EMPLOYEES;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ODBC CONNECT TO [orcl-sh;DBQ=ORCL ] (XUserId is bBUAXZBNWG, XPassword is ZVbbVZBNfG);&lt;/P&gt;&lt;P&gt;LOAD "CHANNEL_ID",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "CHANNEL_DESC",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "CHANNEL_CLASS",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "CHANNEL_CLASS_ID",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "CHANNEL_TOTAL",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "CHANNEL_TOTAL_ID";&lt;/P&gt;&lt;P&gt;SQL SELECT *&lt;/P&gt;&lt;P&gt;FROM SH.CHANNELS;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think the same idea would work for your databases.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards, Ferran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jan 2012 18:01:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Connections-with-more-than-one-databases-in-the-same-document/m-p/318251#M706432</guid>
      <dc:creator>Ferran_Garcia_Pagans</dc:creator>
      <dc:date>2012-01-30T18:01:10Z</dc:date>
    </item>
    <item>
      <title>Connections with more than one databases in the same document</title>
      <link>https://community.qlik.com/t5/QlikView/Connections-with-more-than-one-databases-in-the-same-document/m-p/318252#M706433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;maybe a better approach is to put all the load statements into on sub and call it twice:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sub loading&lt;/P&gt;&lt;P&gt;LOAD ...&lt;/P&gt;&lt;P&gt;LOAD ...&lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;connect first_db ...;&lt;/P&gt;&lt;P&gt;call loadsub;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;connect second_db ...;&lt;/P&gt;&lt;P&gt;call loadsub;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;- Ralf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jan 2012 18:54:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Connections-with-more-than-one-databases-in-the-same-document/m-p/318252#M706433</guid>
      <dc:creator>rbecher</dc:creator>
      <dc:date>2012-01-30T18:54:50Z</dc:date>
    </item>
    <item>
      <title>Connections with more than one databases in the same document</title>
      <link>https://community.qlik.com/t5/QlikView/Connections-with-more-than-one-databases-in-the-same-document/m-p/318253#M706434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, Ferran and Ralf.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using the following code to connect to the first server:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ODBC CONNECT TO SERVER1;&lt;/P&gt;&lt;P&gt;Stores:&lt;/P&gt;&lt;P&gt;LOAD var1, var2, var3, var4;&lt;/P&gt;&lt;P&gt;SQL &lt;/P&gt;&lt;P&gt;SELECT * FROM s19.table1 Where notetype &amp;lt;&amp;gt; 0&amp;nbsp; UNION &lt;/P&gt;&lt;P&gt;SELECT * FROM s20.table1 Where notetype &amp;lt;&amp;gt; 0&amp;nbsp; UNION &lt;/P&gt;&lt;P&gt;SELECT * FROM s21.table1 Where notetype &amp;lt;&amp;gt; 0&amp;nbsp; UNION &lt;/P&gt;&lt;P&gt;SELECT * FROM s25.table1 Where notetype &amp;lt;&amp;gt; 0&amp;nbsp; UNION &lt;/P&gt;&lt;P&gt;SELECT * FROM s26.table1 Where notetype &amp;lt;&amp;gt; 0&amp;nbsp; UNION&lt;/P&gt;&lt;P&gt;SELECT * FROM s27.table1 Where notetype &amp;lt;&amp;gt; 0&amp;nbsp; UNION &lt;/P&gt;&lt;P&gt;SELECT * FROM s28.table1 Where notetype &amp;lt;&amp;gt; 0&amp;nbsp; UNION &lt;/P&gt;&lt;P&gt;SELECT * FROM s29.table1 Where notetype &amp;lt;&amp;gt; 0&amp;nbsp; UNION &lt;/P&gt;&lt;P&gt;SELECT * FROM s30.table1 Where notetype &amp;lt;&amp;gt; 0&amp;nbsp; UNION &lt;/P&gt;&lt;P&gt;SELECT * FROM s31.table1 Where notetype &amp;lt;&amp;gt; 0&amp;nbsp; UNION&lt;/P&gt;&lt;P&gt;SELECT * FROM s32.table1 Where notetype &amp;lt;&amp;gt; 0&amp;nbsp; UNION &lt;/P&gt;&lt;P&gt;SELECT * FROM s33.table1 Where notetype &amp;lt;&amp;gt; 0&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This loads the data for store numbers greater than 19 into table "Stores". I have made few interactive charts using this table. Now, Our first 18 stores are on different server. My question is, how can I load the data for those 18 stores also into Stores table so that my already created charts and tables work for those stores too. &lt;/P&gt;&lt;P&gt;Is it possible? &lt;/P&gt;&lt;P&gt;Like, Feran and Ralf suggested, I can create two saparate tables for the data from the two servers but then can i link those tables to the same charts? In other words, can charts and tables take data from different tables depending upon the selection of the store? &lt;/P&gt;&lt;P&gt;I hope I have not made it more complecated. please ask me any clarification if you need.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jan 2012 20:45:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Connections-with-more-than-one-databases-in-the-same-document/m-p/318253#M706434</guid>
      <dc:creator />
      <dc:date>2012-01-30T20:45:44Z</dc:date>
    </item>
    <item>
      <title>Connections with more than one databases in the same document</title>
      <link>https://community.qlik.com/t5/QlikView/Connections-with-more-than-one-databases-in-the-same-document/m-p/318254#M706435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can load multiple times into one table. In your case I would do a for .. each loop with a vStore variable:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ODBC CONNECT TO SERVER1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for each &lt;STRONG&gt;vStore &lt;/STRONG&gt;in&lt;STRONG&gt; 's01', 's02', ...&lt;/STRONG&gt;etc.&lt;/P&gt;&lt;P&gt;Stores:&lt;/P&gt;&lt;P&gt;SQL SELECT var1, var2, var3, var4 FROM &lt;STRONG&gt;$(vStore)&lt;/STRONG&gt;.table1 Where notetype &amp;lt;&amp;gt; 0; // No UNION needed!&lt;/P&gt;&lt;P&gt;next vStore;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ODBC CONNECT TO SERVER2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for each &lt;STRONG&gt;vStore &lt;/STRONG&gt;in &lt;STRONG&gt;'s19', 's20', ...&lt;/STRONG&gt;etc.&lt;/P&gt;&lt;P&gt;Stores:&lt;/P&gt;&lt;P&gt;SQL SELECT var1, var2, var3, var4 FROM &lt;STRONG&gt;$(vStore)&lt;/STRONG&gt;.table1 Where notetype &amp;lt;&amp;gt; 0; // No UNION needed!&lt;/P&gt;&lt;P&gt;next vStore;&lt;/P&gt;&lt;P&gt;------------&lt;/P&gt;&lt;P&gt;If the store numbers are ongoing you could also use a FOR .. NEXT loop with a counter variable:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for vStore = 1 to 19&lt;/P&gt;&lt;P&gt;..&lt;/P&gt;&lt;P&gt;next;&lt;/P&gt;&lt;P&gt;------------&lt;/P&gt;&lt;P&gt;- Ralf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jan 2012 21:27:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Connections-with-more-than-one-databases-in-the-same-document/m-p/318254#M706435</guid>
      <dc:creator>rbecher</dc:creator>
      <dc:date>2012-01-30T21:27:44Z</dc:date>
    </item>
  </channel>
</rss>

