<?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: Left join result in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Left-join-result/m-p/342226#M704584</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why I am trying to replicate in OV? &lt;/P&gt;&lt;P&gt;Mostly because in SQL data are imported manually and this is what we want to elliminate first. &lt;/P&gt;&lt;P&gt;We also have more systems from where data are comming daily or monthly in csv, txt or xls files and we want to combine them, something that now we don't have in sql. &lt;/P&gt;&lt;P&gt;If someone has a better idea or knows a better method, please tell me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Olivia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Apr 2012 06:25:02 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-04-10T06:25:02Z</dc:date>
    <item>
      <title>Left join result</title>
      <link>https://community.qlik.com/t5/QlikView/Left-join-result/m-p/342219#M704577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hello,&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;I have 2 tables, Temp with 753878 lines and Relations with 4120 lines.&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;In SQL I have a left join script:&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;Load * from Temp it LEFT JOIN&lt;BR /&gt; Relations r ON SUBSTRING(Position, 5, 2) = r.VG AND SUBSTRING(Position, 7, 2) = r.RelationNr AND r.Branch = it.Branch&lt;/DIV&gt;&lt;DIV&gt;This left join in SQL brings me 753881 lines.&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;I made a similar script in Qlik, where I stored Temp and Relations in 2 qvd files. For having the 3 fields correspondent, I created a common key.&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;So I have this:&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;Load *,&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&lt;SPAN style="color: #008000;"&gt; Branch&amp;amp;VG&amp;amp;RelationNr as RelationKey&lt;/SPAN&gt;&lt;DIV&gt;FROM&lt;/DIV&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 8pt;"&gt;D:\QVDs\Temp.qvd (&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;qvd&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;);&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;left join &lt;BR /&gt; LOAD&amp;nbsp; &lt;BR /&gt; CostCenter, &lt;BR /&gt; BusinessArea, &lt;BR /&gt; RelationGroup, &lt;BR /&gt; RelationName, &lt;BR /&gt; Branch&amp;amp;VG&amp;amp;RelationNr as RelationKey&lt;BR /&gt; FROM&lt;BR /&gt;D:\QVDs\Relations2011_.qvd (qvd); &lt;/SPAN&gt;&lt;/DIV&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;In QlikView, this left join brings me 753887 lines.&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;Can someone tell me why is this difference between this two similar join's in SQL and QlikView?&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;10x a lot! &lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;Regards, Olivia&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Apr 2012 08:09:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Left-join-result/m-p/342219#M704577</guid>
      <dc:creator />
      <dc:date>2012-04-09T08:09:11Z</dc:date>
    </item>
    <item>
      <title>Left join result</title>
      <link>https://community.qlik.com/t5/QlikView/Left-join-result/m-p/342220#M704578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi,&lt;/P&gt;&lt;P&gt;Is your key numeric ? I can find only one possiblity that after concatenating key valyes to create relationkey there must be duplicate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please try Branch&amp;amp;'_'&amp;amp;VG&amp;amp;'_'&amp;amp;RelationNR as RelationKey&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or instead of creating key you can directly do your left join on three fields&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;Field1,&lt;/P&gt;&lt;P&gt;Field2,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;Branch,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;VG,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;RelationNr &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;From Temp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;Left Join&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;Load&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;Field4,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;Field5,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;Branch,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;VG,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;RelationNr &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;From Relation;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;Hope this will help.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Apr 2012 08:26:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Left-join-result/m-p/342220#M704578</guid>
      <dc:creator>vijay_iitkgp</dc:creator>
      <dc:date>2012-04-09T08:26:48Z</dc:date>
    </item>
    <item>
      <title>Left join result</title>
      <link>https://community.qlik.com/t5/QlikView/Left-join-result/m-p/342221#M704579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; My first question mark is why in SQL, if I make left join between Temp which has 753878 lines and Relations with 4120 lines, the result table has 753881 lines and not 753878 as first table? May be because in Relations can be duplicates?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Apr 2012 08:35:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Left-join-result/m-p/342221#M704579</guid>
      <dc:creator />
      <dc:date>2012-04-09T08:35:49Z</dc:date>
    </item>
    <item>
      <title>Left join result</title>
      <link>https://community.qlik.com/t5/QlikView/Left-join-result/m-p/342222#M704580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Exactly.&amp;nbsp; The LEFT JOIN means you won't get any records from Relations that don't join to a row in Temp.&amp;nbsp; However, if two different rows from Relations join to the same row in Temp, that row will be duplicated - once for each of the two different Relations values.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Apr 2012 08:40:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Left-join-result/m-p/342222#M704580</guid>
      <dc:creator>Jason_Michaelides</dc:creator>
      <dc:date>2012-04-09T08:40:23Z</dc:date>
    </item>
    <item>
      <title>Left join result</title>
      <link>https://community.qlik.com/t5/QlikView/Left-join-result/m-p/342223#M704581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; no because if it is duplicate then it should result same in SQL also. But there may be possibilit that RelationKey is duplicate &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eg:&lt;/P&gt;&lt;P&gt;If Branch =12 VG=315 and relationNr=26&lt;/P&gt;&lt;P&gt;and &lt;/P&gt;&lt;P&gt;If Branch=123 , VG 152 and RelationNr=6&lt;/P&gt;&lt;P&gt;In both cases Key is 1231526&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just try to left join without creating key&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Apr 2012 08:43:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Left-join-result/m-p/342223#M704581</guid>
      <dc:creator>vijay_iitkgp</dc:creator>
      <dc:date>2012-04-09T08:43:13Z</dc:date>
    </item>
    <item>
      <title>Left join result</title>
      <link>https://community.qlik.com/t5/QlikView/Left-join-result/m-p/342224#M704582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; I already done without creating the key and the result is the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; I created a key with separator "_" and I saw that I have exactly 9 duplicates in 5 lines. I will try to solve the duplicates problem and see what happends. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you all! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a nice day! Olivia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Apr 2012 08:49:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Left-join-result/m-p/342224#M704582</guid>
      <dc:creator />
      <dc:date>2012-04-09T08:49:27Z</dc:date>
    </item>
    <item>
      <title>Left join result</title>
      <link>https://community.qlik.com/t5/QlikView/Left-join-result/m-p/342225#M704583</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why are you trying to replicate this functionality in QV anyway?&amp;nbsp; Unless you have a good reason to, let SQL do what it is good at, which is basic joins to present a limited subset of data.&amp;nbsp; Otherwise, you will slow your load script down unnecessarily.&amp;nbsp; Take the following situation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table TempIT in your SQL database has 50,000 rows.&lt;/P&gt;&lt;P&gt;Table Relations in your db has 100,000 rows.&lt;/P&gt;&lt;P&gt;Only 25,000 rows in Relations are linked to TempIT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;SQL SELECT * FROM TempIT LEFT JOIN Relations ON....;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will take x seconds to run and will present 50,000 rows (plus any duplicate joins)&amp;nbsp; to QlikView, which is all it needs.&amp;nbsp; SQL deals with basic joins very efficiently and so db load shouldn't be a worrysome factor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, if you load the entire TempIT table into a QVD, then load the entire Relations table into a second QVD, then use QlikView to join them, it first has to load both tables then perform the joins.&amp;nbsp; This will most likely take longer than letting SQL join the data and QV needs to deal with 150,000 rows of data whereas it only really needs to see 50,000.&amp;nbsp; Plus you are asking SQL to return 150,000 rows of data instead of only 50,000.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, unless you NEED all the Relations data inside a QVD file (maybe for other uses - even then I would question whether you should use it here) then let SQL do what it is good at (basic stuff) and do the clever bits in QV.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jason&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Apr 2012 19:21:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Left-join-result/m-p/342225#M704583</guid>
      <dc:creator>Jason_Michaelides</dc:creator>
      <dc:date>2012-04-09T19:21:11Z</dc:date>
    </item>
    <item>
      <title>Re: Left join result</title>
      <link>https://community.qlik.com/t5/QlikView/Left-join-result/m-p/342226#M704584</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why I am trying to replicate in OV? &lt;/P&gt;&lt;P&gt;Mostly because in SQL data are imported manually and this is what we want to elliminate first. &lt;/P&gt;&lt;P&gt;We also have more systems from where data are comming daily or monthly in csv, txt or xls files and we want to combine them, something that now we don't have in sql. &lt;/P&gt;&lt;P&gt;If someone has a better idea or knows a better method, please tell me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Olivia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Apr 2012 06:25:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Left-join-result/m-p/342226#M704584</guid>
      <dc:creator />
      <dc:date>2012-04-10T06:25:02Z</dc:date>
    </item>
    <item>
      <title>Left join result</title>
      <link>https://community.qlik.com/t5/QlikView/Left-join-result/m-p/342227#M704585</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you're dealing with non-DB files then a structure of QVD files may well make sense. Your example above speaks of 2 SQL tables with a known join however, so I was referring to that situation with my comment above. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jason&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Apr 2012 07:53:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Left-join-result/m-p/342227#M704585</guid>
      <dc:creator>Jason_Michaelides</dc:creator>
      <dc:date>2012-04-10T07:53:55Z</dc:date>
    </item>
  </channel>
</rss>

