<?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 Combine data from multiple datasources in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Combine-data-from-multiple-datasources/m-p/228369#M80405</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have two datasources, one is excel file(one small table) &amp;amp; the other is a SQL Server (millions of records)&lt;/P&gt;&lt;P&gt;I need to pull in data from the SQL server based on the values i extract from the Excel file.&lt;/P&gt;&lt;P&gt;I was thinking i will do the following:&lt;/P&gt;&lt;P&gt;1) Pull in the list of companies from the Excel file into a resident table first&lt;/P&gt;&lt;P&gt;2) write a Query in script tab to Load the data from SQLDatabase by passing the list of companies i get from the Excel file&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need help with syntax of how do i pass the list of companies in a SQL query ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Apr 2010 19:36:26 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-04-29T19:36:26Z</dc:date>
    <item>
      <title>Combine data from multiple datasources</title>
      <link>https://community.qlik.com/t5/QlikView/Combine-data-from-multiple-datasources/m-p/228369#M80405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have two datasources, one is excel file(one small table) &amp;amp; the other is a SQL Server (millions of records)&lt;/P&gt;&lt;P&gt;I need to pull in data from the SQL server based on the values i extract from the Excel file.&lt;/P&gt;&lt;P&gt;I was thinking i will do the following:&lt;/P&gt;&lt;P&gt;1) Pull in the list of companies from the Excel file into a resident table first&lt;/P&gt;&lt;P&gt;2) write a Query in script tab to Load the data from SQLDatabase by passing the list of companies i get from the Excel file&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need help with syntax of how do i pass the list of companies in a SQL query ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Apr 2010 19:36:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Combine-data-from-multiple-datasources/m-p/228369#M80405</guid>
      <dc:creator />
      <dc:date>2010-04-29T19:36:26Z</dc:date>
    </item>
    <item>
      <title>Combine data from multiple datasources</title>
      <link>https://community.qlik.com/t5/QlikView/Combine-data-from-multiple-datasources/m-p/228370#M80406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Assuming you have a common field, say CompanyID, in both Excel and database table, it may look like this:&lt;BR /&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;Excel:&lt;BR /&gt;LOAD&lt;BR /&gt; &lt;STRONG&gt;CompanyID&lt;/STRONG&gt;,&lt;BR /&gt; &amp;lt;whatever esle you need from Exccel&amp;gt;&lt;BR /&gt;FROM ...;&lt;BR /&gt;Data:&lt;BR /&gt;&lt;STRONG&gt;LEFT KEEP&lt;/STRONG&gt; LOAD&lt;BR /&gt; *&lt;BR /&gt;;&lt;BR /&gt;SQL SELECT&lt;BR /&gt; &lt;STRONG&gt;CompanyID&lt;/STRONG&gt;,&lt;BR /&gt; ...&lt;BR /&gt;FROM &amp;lt;database.table&amp;gt;;&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Or it could be&lt;BR /&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;Data:&lt;BR /&gt;LOAD&lt;BR /&gt; *&lt;BR /&gt;WHERE exists&lt;STRONG&gt;(CompanyID);&lt;/STRONG&gt;&lt;BR /&gt;SQL SELECT&lt;BR /&gt; CompanyID,&lt;BR /&gt; ...&lt;BR /&gt;FROM &amp;lt;database.table&amp;gt;;&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Apr 2010 19:53:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Combine-data-from-multiple-datasources/m-p/228370#M80406</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-04-29T19:53:43Z</dc:date>
    </item>
    <item>
      <title>Combine data from multiple datasources</title>
      <link>https://community.qlik.com/t5/QlikView/Combine-data-from-multiple-datasources/m-p/228371#M80407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If your Excel data will restrict your main load to only a small portion of the available rows, and if your data is indexed to support it, you may want to throw out the bad data on the SQL Server side instead of on the QlikView side. That way, hopefully SQL Server won't waste time retrieving millions of rows of data you don't want. I don't guarantee I have exactly the right syntax, but something like this:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;Excel:&lt;BR /&gt;LOAD&lt;BR /&gt; CompanyID,&lt;BR /&gt; &amp;lt;whatever else you need from Excel&amp;gt;&lt;BR /&gt;FROM ...&lt;BR /&gt;;&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;GoodIDs:&lt;BR /&gt;LOAD DISTINCT CompanyID&lt;BR /&gt;RESIDENT Excel&lt;BR /&gt;;&lt;BR /&gt;SET IDs = chr(39) &amp;amp; peek('GoodIDs',0,'ID') &amp;amp; chr(39);&lt;BR /&gt;FOR I = 1 TO noofrows('GoodIDs')-1&lt;BR /&gt; LET IDs = IDs &amp;amp; ',' &amp;amp; chr(39) &amp;amp; peek('GoodIDs',I,'ID') &amp;amp; chr(39);&lt;BR /&gt;NEXT I&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;DROP TABLE GoodIDs&lt;BR /&gt;;&lt;BR /&gt;Data:&lt;BR /&gt;LOAD&lt;BR /&gt;...&lt;BR /&gt;;&lt;BR /&gt;SQL SELECT&lt;BR /&gt; CompanyID,&lt;BR /&gt;...&lt;BR /&gt;WHERE CompanyID IN ($(IDs))&lt;BR /&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Apr 2010 20:26:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Combine-data-from-multiple-datasources/m-p/228371#M80407</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-04-29T20:26:52Z</dc:date>
    </item>
    <item>
      <title>Combine data from multiple datasources</title>
      <link>https://community.qlik.com/t5/QlikView/Combine-data-from-multiple-datasources/m-p/228372#M80408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;By coincidence, I just needed to do this for the first time with some new stuff I'm working on today. Or maybe when you're carrying a hammer, everything looks like a nail. In any case I debugged the code above and used it in an application I'm developing, at least temporarily. Here's the actual, working code:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;BadIDs:&lt;BR /&gt;LOAD DISTINCT "Change Control with Bad Update" as "ID"&lt;BR /&gt;RESIDENT [Change Control History]&lt;BR /&gt;;&lt;BR /&gt;LET IDs = '';&lt;BR /&gt;FOR I = 0 TO noofrows('BadIDs')-1&lt;BR /&gt; LET IDs = IDs &amp;amp; ',' &amp;amp; chr(39) &amp;amp; peek('ID',I,'BadIDs') &amp;amp; chr(39);&lt;BR /&gt;NEXT I&lt;BR /&gt;LET IDs = mid(IDs,2);&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;DROP TABLE BadIDs&lt;BR /&gt;;&lt;BR /&gt;[Bad Change Controls]:&lt;BR /&gt;LOAD *&lt;BR /&gt;,DEID as "Change Control with Bad Update"&lt;BR /&gt;;&lt;BR /&gt;SQL SELECT *&lt;BR /&gt;FROM SYSTLC.ATDE101R&lt;BR /&gt;WHERE DEID IN ($(IDs))&lt;BR /&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Apr 2010 23:05:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Combine-data-from-multiple-datasources/m-p/228372#M80408</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-04-29T23:05:40Z</dc:date>
    </item>
    <item>
      <title>Combine data from multiple datasources</title>
      <link>https://community.qlik.com/t5/QlikView/Combine-data-from-multiple-datasources/m-p/228373#M80409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Brilliant &lt;IMG alt="Big Smile" src="http://community.qlik.com/emoticons/emotion-2.gif" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 May 2010 21:21:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Combine-data-from-multiple-datasources/m-p/228373#M80409</guid>
      <dc:creator />
      <dc:date>2010-05-12T21:21:49Z</dc:date>
    </item>
    <item>
      <title>Combine data from multiple datasources</title>
      <link>https://community.qlik.com/t5/QlikView/Combine-data-from-multiple-datasources/m-p/228374#M80410</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;I'm trying to do the same but with a &lt;STRONG&gt;resident table&lt;/STRONG&gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To use your example, it would be like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[A_TABLE]:&lt;/P&gt;&lt;P&gt;LOAD col1, col2&lt;/P&gt;&lt;P&gt;resident A_RESIDENT_TABLE WHERE col1 IN ($(IDs)) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get a "&lt;STRONG style="font-size: 1.1111em; display: block;"&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/message/121819#121819" style="font-size: 12px; color: #555555;"&gt;Garbage after statement&lt;/A&gt;&lt;/STRONG&gt;" error message &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/shocked.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;L.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jun 2011 16:34:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Combine-data-from-multiple-datasources/m-p/228374#M80410</guid>
      <dc:creator />
      <dc:date>2011-06-30T16:34:13Z</dc:date>
    </item>
  </channel>
</rss>

