<?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 with sql join over two tables of the same datasouce in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Load-with-sql-join-over-two-tables-of-the-same-datasouce/m-p/454912#M695644</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello @all&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to reload a report every 5 min. In order not to overload the datasource I thought of doing&amp;nbsp; sql query on the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My idea is to do sth like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load*;&lt;/P&gt;&lt;P&gt;SQL Select&lt;/P&gt;&lt;P&gt;Table1.Field1,&lt;/P&gt;&lt;P&gt;Table1.Field2,&lt;/P&gt;&lt;P&gt;Table2.Field1,&lt;/P&gt;&lt;P&gt;Max(Table2.Field2) as Tbl2F2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From ds1.Table1, ds1.Table2&lt;/P&gt;&lt;P&gt;Where Table1.Field1=Table2.Field1&lt;/P&gt;&lt;P&gt;Group By Table1.Field1, Table1.Field2, Table2.Field1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this possible and if yes where is the difference in the performance to the following code?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load*;&lt;/P&gt;&lt;P&gt;SQL Select&lt;/P&gt;&lt;P&gt;Field1,&lt;/P&gt;&lt;P&gt;Max(Field2) as Tbl2F2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From&amp;nbsp; ds1.Table2 &lt;/P&gt;&lt;P&gt;Group By Table2.Field1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left Join&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load*;&lt;/P&gt;&lt;P&gt;SQL Select&lt;/P&gt;&lt;P&gt;Field1,&lt;/P&gt;&lt;P&gt;Field2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From&amp;nbsp; ds1.Table1;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 15 Apr 2013 14:21:13 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-04-15T14:21:13Z</dc:date>
    <item>
      <title>Load with sql join over two tables of the same datasouce</title>
      <link>https://community.qlik.com/t5/QlikView/Load-with-sql-join-over-two-tables-of-the-same-datasouce/m-p/454912#M695644</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello @all&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to reload a report every 5 min. In order not to overload the datasource I thought of doing&amp;nbsp; sql query on the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My idea is to do sth like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load*;&lt;/P&gt;&lt;P&gt;SQL Select&lt;/P&gt;&lt;P&gt;Table1.Field1,&lt;/P&gt;&lt;P&gt;Table1.Field2,&lt;/P&gt;&lt;P&gt;Table2.Field1,&lt;/P&gt;&lt;P&gt;Max(Table2.Field2) as Tbl2F2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From ds1.Table1, ds1.Table2&lt;/P&gt;&lt;P&gt;Where Table1.Field1=Table2.Field1&lt;/P&gt;&lt;P&gt;Group By Table1.Field1, Table1.Field2, Table2.Field1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this possible and if yes where is the difference in the performance to the following code?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load*;&lt;/P&gt;&lt;P&gt;SQL Select&lt;/P&gt;&lt;P&gt;Field1,&lt;/P&gt;&lt;P&gt;Max(Field2) as Tbl2F2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From&amp;nbsp; ds1.Table2 &lt;/P&gt;&lt;P&gt;Group By Table2.Field1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left Join&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load*;&lt;/P&gt;&lt;P&gt;SQL Select&lt;/P&gt;&lt;P&gt;Field1,&lt;/P&gt;&lt;P&gt;Field2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From&amp;nbsp; ds1.Table1;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Apr 2013 14:21:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-with-sql-join-over-two-tables-of-the-same-datasouce/m-p/454912#M695644</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-04-15T14:21:13Z</dc:date>
    </item>
    <item>
      <title>Re: Load with sql join over two tables of the same datasouce</title>
      <link>https://community.qlik.com/t5/QlikView/Load-with-sql-join-over-two-tables-of-the-same-datasouce/m-p/454913#M695645</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13660964538499563" jivemacro_uid="_13660964538499563"&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MAX_MAC_STA:&lt;/P&gt;&lt;P&gt;Load *;&lt;BR /&gt;SQL SELECT &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lJobRef,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lMacRef,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Max(lMacStaRef) as [letzter Status]&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;FROM TIG1.dbo."MAC_STA"&lt;BR /&gt;Group By lMacRef, lJobRef;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Outer Join&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load *;&lt;BR /&gt;SQL SELECT &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lJobRef,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lMacRef,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Max(lMacStaRef) as [letzter Status]&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;FROM TIG1.dbo."MAC_STA"&lt;BR /&gt;Where (iMState In (2,5))&lt;BR /&gt;Group By lMacRef, lJobRef;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;left join &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load *; &lt;BR /&gt;SQL SELECT dActShots as [Schussmenge Status Ist],&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; iMState,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; iPState,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lMacStaRef as [letzter Status],&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; tBegin as [Status Beginn],&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; tEnd as [Status Ende]&lt;/P&gt;&lt;P&gt;FROM TIG1.dbo."MAC_STA";&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;left Join&lt;/P&gt;&lt;P&gt;LOAD *;&lt;BR /&gt;SQL SELECT dActShots as [Schussmenge Job Ist],&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dActSpeed as Zykluszeit,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dSetShots as [Schussmenge Job Soll],&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lJobRef,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sName as Auftrag,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sType,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; tActBegin as Auftragsbeginn,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; tActEnd as Auftragsende&lt;BR /&gt;FROM TIG1.dbo.JOB;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;Maybe you can help me with this code. My aim is to do as much as possible on the db side. I dont want to load a whole table in order to do joins on QV side.&lt;/P&gt;&lt;P&gt;I wanted first to do a join between a resident table and a db, but these a two different "source" systems...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code is working fine like this, but as i said it probably loads to much data in qv. And as I have to repeat this every 5 min , I dont want to load too much &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thx in advance. chesterluck&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Apr 2013 07:12:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-with-sql-join-over-two-tables-of-the-same-datasouce/m-p/454913#M695645</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-04-16T07:12:39Z</dc:date>
    </item>
  </channel>
</rss>

