<?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: How to connect and load data from different servers and put them in one table in Qlikview? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-connect-and-load-data-from-different-servers-and-put-them/m-p/353810#M705181</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;Yes I did not realise that the dbs were on different servers. You could put the information to build the connection string into the inline table and connect in the outer loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't do a complete solution now - I can do it&amp;nbsp; in a few hours time. I don't know much about Postgres connection strings, but I am sure that if I do the example with SQL Server strings you can work out what you need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Apr 2012 13:08:32 GMT</pubDate>
    <dc:creator>jonathandienst</dc:creator>
    <dc:date>2012-04-18T13:08:32Z</dc:date>
    <item>
      <title>How to connect and load data from different servers and put them in one table in Qlikview?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-connect-and-load-data-from-different-servers-and-put-them/m-p/353807#M705178</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am new to qlikview and working on creating a reporting tool. We have 50 stores, the data for which are stored in two different postgres server. For simplicity lets say server1 and server2 each has 25 stores. Each server has 25 schemas in whcih all the information about each store is stored in several tables. In server1 I have 25 stores in schema s1 to s25 and in server2 I have other stores from schema s26 to s50.&amp;nbsp; &lt;/P&gt;&lt;P&gt;I am facing two chalanges: &lt;/P&gt;&lt;P&gt;1) Inefficient coding: crruently I connect and load data from each server for each store using code which looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;ODBC CONNECT TO Server1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//******Table1******&lt;/P&gt;&lt;P&gt;Sales:&lt;/P&gt;&lt;P&gt;LOAD companyid, itemid, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; custid, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; itemschedule, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; itempayments, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; itemamount, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; overridereason&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;SQL &lt;/P&gt;&lt;P&gt;SELECT &lt;/P&gt;&lt;P&gt;companyid, itemid,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; custid, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; itemschedule, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; itempayments, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; itemamount, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; overridereason&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FROM db1.s1.tab1 Where noteorigin &amp;lt;&amp;gt; 0 and notestatus = 1 &lt;/P&gt;&lt;P&gt;UNION &lt;/P&gt;&lt;P&gt;SELECT &lt;/P&gt;&lt;P&gt;companyid, itemid, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; custid, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; itemschedule, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; itempayments, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; itemamount, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; overridereason&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FROM db1.s2.tab1 Where noteorigin &amp;lt;&amp;gt; 0 and notestatus = 1 &lt;/P&gt;&lt;P&gt; UNION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;I join 23 (by changing schema number from s1 to s25) moreselect statements with UNION to get data from server1 and then do the samething for server2. And this is just to get sales talbes. I have several othertables to load for reporting purpose.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Second chalange is that even after doing this I gettwo saparate tables for sales data in table viwer.&amp;nbsp;&amp;nbsp; I would like to have sales data for all 50stores in one table in qlikview.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can I create a loop which will run the query by loopingthrough schemas from s1 to s25?&lt;/P&gt;&lt;P&gt;Can I load all 50 stores in one table in qlikview?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: samarth.shah&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Apr 2012 17:52:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-connect-and-load-data-from-different-servers-and-put-them/m-p/353807#M705178</guid>
      <dc:creator />
      <dc:date>2012-04-16T17:52:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to connect and load data from different servers and put them in one table in Qlikview?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-connect-and-load-data-from-different-servers-and-put-them/m-p/353808#M705179</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;This is the sort of code you could use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;TableMap:&lt;/P&gt;&lt;P&gt;LOAD * Inline&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Server, Schemas&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; db1, 25&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; db2, 25&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For zi = 1 To NoOfRows('TableMap')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Let zServer = FieldValue('Server', zi);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Let zSchemaCount = FieldValue('Schemas', zi);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; For zj = 1 To zSchemaCount&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sales:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SQL SELECT companyid, &lt;/P&gt;&lt;P&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; itemid,&lt;/P&gt;&lt;P&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; custid, &lt;/P&gt;&lt;P&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; itemschedule, &lt;/P&gt;&lt;P&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; itempayments, &lt;/P&gt;&lt;P&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; itemamount, &lt;/P&gt;&lt;P&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; overridereason&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 $(zServer).s$(zj).tab1 Where noteorigin &amp;lt;&amp;gt; 0 and notestatus = 1&amp;nbsp; &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;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Adjust the contents of the inline load to match your requirements, If the schema naming is not numeric, you could put a server/schemaname lookup in the inline and iterate over that instead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Apr 2012 18:21:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-connect-and-load-data-from-different-servers-and-put-them/m-p/353808#M705179</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2012-04-16T18:21:12Z</dc:date>
    </item>
    <item>
      <title>How to connect and load data from different servers and put them in one table in Qlikview?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-connect-and-load-data-from-different-servers-and-put-them/m-p/353809#M705180</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, Jonathan. It reduced my code by a lot. However it works for each server individually. I dont know how to handle two connections. Where should I put CONNECT TO statements in the loop? so that all 50 store's sales table load into the Sales table in Qlikview.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2012 15:21:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-connect-and-load-data-from-different-servers-and-put-them/m-p/353809#M705180</guid>
      <dc:creator />
      <dc:date>2012-04-17T15:21:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to connect and load data from different servers and put them in one table in Qlikview?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-connect-and-load-data-from-different-servers-and-put-them/m-p/353810#M705181</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;Yes I did not realise that the dbs were on different servers. You could put the information to build the connection string into the inline table and connect in the outer loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't do a complete solution now - I can do it&amp;nbsp; in a few hours time. I don't know much about Postgres connection strings, but I am sure that if I do the example with SQL Server strings you can work out what you need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2012 13:08:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-connect-and-load-data-from-different-servers-and-put-them/m-p/353810#M705181</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2012-04-18T13:08:32Z</dc:date>
    </item>
    <item>
      <title>How to connect and load data from different servers and put them in one table in Qlikview?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-connect-and-load-data-from-different-servers-and-put-them/m-p/353811#M705182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see what you mean. I think I can create connection string using inline table. Thanks a lot.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2012 20:40:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-connect-and-load-data-from-different-servers-and-put-them/m-p/353811#M705182</guid>
      <dc:creator />
      <dc:date>2012-04-18T20:40:26Z</dc:date>
    </item>
  </channel>
</rss>

