<?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 JOIN help in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/JOIN-help/m-p/143781#M22909</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Franck,&lt;/P&gt;&lt;P&gt;I don't exactly understand what you want to achieve but I think you just want to add the country and region from the flatfile to the Data table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;&lt;STRONG&gt;Data:&lt;BR /&gt;&lt;/STRONG&gt;LOAD ....,&lt;BR /&gt; Site_index,&lt;BR /&gt; .............&lt;BR /&gt;SQL SELECT * FROM maDB;&lt;BR /&gt;&lt;STRONG&gt;LEFT JOIN (Data)&lt;BR /&gt;&lt;/STRONG&gt;LOAD Site_index,&lt;BR /&gt; Country,&lt;BR /&gt; Region&lt;BR /&gt;FROM [Data/Mapping/Site_index.xls,Sheet is...]&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;In your script you are joining the Site_index table with the same table, do you have a reason for that or is it a mistake?&lt;/P&gt;&lt;P&gt;regards Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 10 May 2009 18:55:58 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-05-10T18:55:58Z</dc:date>
    <item>
      <title>JOIN help</title>
      <link>https://community.qlik.com/t5/QlikView/JOIN-help/m-p/143780#M22908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everybody !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like, in one of my project, to join two tables.&lt;BR /&gt;I extract from a DB a field (Site_index), which is an index field. We can get from this field the linked values (Country &amp;amp; Region), but this is from a flat file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have this model:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;Data:&lt;/B&gt;&lt;BR /&gt;LOAD ....,&lt;BR /&gt; Site_index,&lt;BR /&gt; .............&lt;BR /&gt;SQL SELECT * FROM maDB;&lt;/P&gt;&lt;P&gt;&lt;B&gt;&lt;BR /&gt;&lt;BR /&gt;Site_index:&lt;/B&gt;&lt;BR /&gt;LOAD Site_index,&lt;BR /&gt; Country,&lt;BR /&gt; Region&lt;BR /&gt;FROM [Data/Mapping/Site_index.xls,Sheet is...]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;LEFT JOIN(Site_index)&lt;BR /&gt;&lt;/B&gt; LOAD Site_index,&lt;BR /&gt; Country,&lt;BR /&gt; Region&lt;BR /&gt;RESIDENT Site_index;&lt;BR /&gt;&lt;BR /&gt;DROP TABLE &lt;B&gt;Site_index;&lt;/B&gt;&lt;/P&gt;&lt;P&gt;I tried using the JOIN function but i don't achieve what i expected.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I had from the DB 33000rows and, after the left JOIN, about 83000 rows..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone help me please ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks !!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 10 May 2009 17:17:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/JOIN-help/m-p/143780#M22908</guid>
      <dc:creator />
      <dc:date>2009-05-10T17:17:30Z</dc:date>
    </item>
    <item>
      <title>JOIN help</title>
      <link>https://community.qlik.com/t5/QlikView/JOIN-help/m-p/143781#M22909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Franck,&lt;/P&gt;&lt;P&gt;I don't exactly understand what you want to achieve but I think you just want to add the country and region from the flatfile to the Data table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;&lt;STRONG&gt;Data:&lt;BR /&gt;&lt;/STRONG&gt;LOAD ....,&lt;BR /&gt; Site_index,&lt;BR /&gt; .............&lt;BR /&gt;SQL SELECT * FROM maDB;&lt;BR /&gt;&lt;STRONG&gt;LEFT JOIN (Data)&lt;BR /&gt;&lt;/STRONG&gt;LOAD Site_index,&lt;BR /&gt; Country,&lt;BR /&gt; Region&lt;BR /&gt;FROM [Data/Mapping/Site_index.xls,Sheet is...]&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;In your script you are joining the Site_index table with the same table, do you have a reason for that or is it a mistake?&lt;/P&gt;&lt;P&gt;regards Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 10 May 2009 18:55:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/JOIN-help/m-p/143781#M22909</guid>
      <dc:creator />
      <dc:date>2009-05-10T18:55:58Z</dc:date>
    </item>
    <item>
      <title>JOIN help</title>
      <link>https://community.qlik.com/t5/QlikView/JOIN-help/m-p/143782#M22910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="jive_text_macro jive_macro_quote" jivemacro="quote"&gt;&lt;BR /&gt;Mark wrote:&lt;BR /&gt;Hello Franck,&lt;BR /&gt;I don't exactly understand what you want to achieve but I think you just want to add the country and region from the flatfile to the Data table:&lt;BR /&gt; &amp;lt;blockquote&amp;gt;&amp;lt;pre&amp;gt;&lt;BR /&gt;&lt;B&gt;Data:&lt;BR /&gt;&lt;/B&gt;LOAD ....,&lt;BR /&gt; Site_index,&lt;BR /&gt; .............&lt;BR /&gt;SQL SELECT * FROM maDB;&lt;BR /&gt;&lt;BR /&gt;&lt;B&gt;LEFT JOIN (Data)&lt;BR /&gt;&lt;/B&gt;LOAD Site_index,&lt;BR /&gt; Country,&lt;BR /&gt; Region&lt;BR /&gt;FROM [Data/Mapping/Site_index.xls,Sheet is...]&lt;/PRE&gt;&lt;P&gt;In your script you are joining the Site_index table with the same table, do you have a reason for that or is it a mistake?&lt;/P&gt;&lt;P&gt;regards Mark&lt;/P&gt;&lt;DIV style="clear:both;"&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, Thanks, Mark,&lt;/P&gt;&lt;P&gt;I think i need to admit it's a mistake...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently, my issue is the following:&lt;BR /&gt;if i only use the db, i've about 30.000 rows. If i use the JOIN, i've got after almost 80.000 rows.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Does anybody know why i got more results using the left join than if i don't ?&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;It seems to me that :&lt;BR /&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;LEFT JOIN(table1)&lt;BR /&gt;LOAD commonField,fieldToAdd1,fieldToAdd2&lt;BR /&gt;Resident table2&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;achieves a left join between the common fields from table1 &amp;amp; table2, parses the table1 for the values, and adds the corresponding fields &lt;BR /&gt;fieldToAdd1 &amp;amp; fieldToAdd2 to the table1, am i wrong ? &lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;So, normally, using it, we preserve the number of rows of the first table (if there are maximum one result thru the JOIN)....&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Can someone help me ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 10 May 2009 19:42:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/JOIN-help/m-p/143782#M22910</guid>
      <dc:creator />
      <dc:date>2009-05-10T19:42:05Z</dc:date>
    </item>
    <item>
      <title>JOIN help</title>
      <link>https://community.qlik.com/t5/QlikView/JOIN-help/m-p/143783#M22911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Franck,&lt;/P&gt;&lt;P&gt;it's a common problem... There are only 2 possible causes:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;You have more records in the second table than you do in the first one - most likely, the key that you expected to be unique, is not. For example, you want to left join Item Master data, assuming that Item is uniquely identified by an Item Number. After loading the data, you might discover, for example, that you also have a Company Number (and each Item is defined separately for each Company), or you might have a Validity Date, and several records per Item, or any other complications that you were not aware of before.&lt;/LI&gt;&lt;LI&gt;You could possibly misspell one of the Join Keys, and as a result QlikView is not joining using that field. If that was your only Key field, you will produce as "Cartesian multiplication", joining everything to everything. If you had 2 or more Join Keys, and you misspelled one of them, you will generate a "many-to-many" multiplication. In your case, since you are loading data from a DB and from Excel, double check your field names - are you getting exactly the same Field names from both? For example, some databases always return the field names in upper case...&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;To get any clues, load the two tables separately and then count the number of distinct values of the "Common Field" in both tables. Compare the total number of rows in the tables to the number of unique key values. If you keys are, in fact, unique, the numbers should match. If any of the numbers are different, then your keys are not unique.&lt;/P&gt;&lt;P&gt;If you'd like to post your script, we could take a look...&lt;/P&gt;&lt;P&gt;Oleg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2009 06:40:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/JOIN-help/m-p/143783#M22911</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2009-05-11T06:40:38Z</dc:date>
    </item>
    <item>
      <title>JOIN help</title>
      <link>https://community.qlik.com/t5/QlikView/JOIN-help/m-p/143784#M22912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think it should be something like this:&lt;/P&gt;&lt;P&gt;if Site_index is your key you should join it with that field.&lt;/P&gt;&lt;P&gt;&lt;B&gt;Data:&lt;/B&gt;&lt;BR /&gt;LOAD ....,&lt;BR /&gt; Site_index,&lt;BR /&gt; .............&lt;BR /&gt;SQL SELECT * FROM maDB;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;LEFT JOIN(Data)&lt;BR /&gt;&lt;/B&gt; LOAD Site_index,&lt;BR /&gt; Country,&lt;BR /&gt; Region&lt;BR /&gt;FROM [Data/Mapping/Site_index.xls,Sheet is...]&lt;/P&gt;&lt;P&gt;Rey-man&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2009 14:12:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/JOIN-help/m-p/143784#M22912</guid>
      <dc:creator />
      <dc:date>2009-05-11T14:12:14Z</dc:date>
    </item>
    <item>
      <title>JOIN help</title>
      <link>https://community.qlik.com/t5/QlikView/JOIN-help/m-p/143785#M22913</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many and many thanks Oleg, i just reviewed my "mapping" file and there was redundant data....&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2009 18:18:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/JOIN-help/m-p/143785#M22913</guid>
      <dc:creator />
      <dc:date>2009-05-11T18:18:48Z</dc:date>
    </item>
  </channel>
</rss>

