<?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 Load Several Tables as 1 in a Loop in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Load-Several-Tables-as-1-in-a-Loop/m-p/146396#M24977</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The general, not syntaxed checked, code would be something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;Ents:&lt;BR /&gt;load ent_id, ent_name, ent_db from entities;&lt;BR /&gt;FOR i = 0 to NoOfRows('Ents') - 1&lt;BR /&gt; LET vDb = peek('ent_db', $(i), 'Ents');&lt;BR /&gt; Data:&lt;BR /&gt; LOAD ent_id, field1, field2 FROM $(vDb).dbo.table1;&lt;BR /&gt;NEXT&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Jun 2009 09:43:41 GMT</pubDate>
    <dc:creator>rwunderlich</dc:creator>
    <dc:date>2009-06-10T09:43:41Z</dc:date>
    <item>
      <title>Load Several Tables as 1 in a Loop</title>
      <link>https://community.qlik.com/t5/QlikView/Load-Several-Tables-as-1-in-a-Loop/m-p/146395#M24976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Would it be possible to loop several tables and load them as one. The loop would come table 1, but then with one of the fields in that table 1 i would need to connect each time to the same table in a different database.&lt;/P&gt;&lt;P&gt;reason, our ERP package stories each entity in a separate database, in a special table i have all entities and their corresponding database name.&lt;/P&gt;&lt;P&gt;I know that i could use a union all in this, but then the entities would be hardcoded, in the dunamically way whenever a entity is added it would load without changes.&lt;/P&gt;&lt;P&gt;A kind a pseudo-code illustrating could be&lt;/P&gt;&lt;P&gt;load ent_id, ent_name, ent_db from entities;&lt;/P&gt;&lt;P&gt;for i = 1 to nbrofrecords(entities) do&lt;/P&gt;&lt;P&gt;load entitiy&lt;I&gt;.end_id, field1, field2, field2 from entity&lt;I&gt;.ent_db.dbo.table1&lt;/I&gt;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;next&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jun 2009 00:58:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-Several-Tables-as-1-in-a-Loop/m-p/146395#M24976</guid>
      <dc:creator />
      <dc:date>2009-06-10T00:58:01Z</dc:date>
    </item>
    <item>
      <title>Load Several Tables as 1 in a Loop</title>
      <link>https://community.qlik.com/t5/QlikView/Load-Several-Tables-as-1-in-a-Loop/m-p/146396#M24977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The general, not syntaxed checked, code would be something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;Ents:&lt;BR /&gt;load ent_id, ent_name, ent_db from entities;&lt;BR /&gt;FOR i = 0 to NoOfRows('Ents') - 1&lt;BR /&gt; LET vDb = peek('ent_db', $(i), 'Ents');&lt;BR /&gt; Data:&lt;BR /&gt; LOAD ent_id, field1, field2 FROM $(vDb).dbo.table1;&lt;BR /&gt;NEXT&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jun 2009 09:43:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-Several-Tables-as-1-in-a-Loop/m-p/146396#M24977</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2009-06-10T09:43:41Z</dc:date>
    </item>
  </channel>
</rss>

