<?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 Confused with join in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Confused-with-join/m-p/1097308#M18445</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi There,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm really confused about the Join function in scripts.&amp;nbsp;&amp;nbsp; I've read several blog entries and the help topics but I'm still not getting it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Take this script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table1:&lt;/P&gt;&lt;P&gt;Load&amp;nbsp; * Inline [&lt;/P&gt;&lt;P&gt;Key, Column1 , Column2&lt;/P&gt;&lt;P&gt;A,1,4&lt;/P&gt;&lt;P&gt;A,2,5&lt;/P&gt;&lt;P&gt;A,3,6&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table2:&lt;/P&gt;&lt;P&gt;Load&amp;nbsp; * Inline [&lt;/P&gt;&lt;P&gt;Key, Column3, Column4 &lt;/P&gt;&lt;P&gt;A,11,44&lt;/P&gt;&lt;P&gt;A,22,55&lt;/P&gt;&lt;P&gt;A,33,66&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Join (Table1)&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;Resident Table2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop table Table2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would expect the product of this to be a nice table something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Key&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Column1&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Column2&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Column3&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Column4&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;4&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;11&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;44&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;5&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;22&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;55&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;6&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;33&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;66&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But instead I get something akin to a Cartesian join.&amp;nbsp;&amp;nbsp;&amp;nbsp; This has me stumped.&amp;nbsp; Both table share a key field (Key!) why am I getting duplicate rows?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 15 Jan 2016 14:29:05 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-01-15T14:29:05Z</dc:date>
    <item>
      <title>Confused with join</title>
      <link>https://community.qlik.com/t5/App-Development/Confused-with-join/m-p/1097308#M18445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi There,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm really confused about the Join function in scripts.&amp;nbsp;&amp;nbsp; I've read several blog entries and the help topics but I'm still not getting it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Take this script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table1:&lt;/P&gt;&lt;P&gt;Load&amp;nbsp; * Inline [&lt;/P&gt;&lt;P&gt;Key, Column1 , Column2&lt;/P&gt;&lt;P&gt;A,1,4&lt;/P&gt;&lt;P&gt;A,2,5&lt;/P&gt;&lt;P&gt;A,3,6&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table2:&lt;/P&gt;&lt;P&gt;Load&amp;nbsp; * Inline [&lt;/P&gt;&lt;P&gt;Key, Column3, Column4 &lt;/P&gt;&lt;P&gt;A,11,44&lt;/P&gt;&lt;P&gt;A,22,55&lt;/P&gt;&lt;P&gt;A,33,66&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Join (Table1)&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;Resident Table2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop table Table2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would expect the product of this to be a nice table something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Key&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Column1&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Column2&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Column3&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Column4&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;4&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;11&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;44&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;5&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;22&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;55&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;6&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;33&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;66&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But instead I get something akin to a Cartesian join.&amp;nbsp;&amp;nbsp;&amp;nbsp; This has me stumped.&amp;nbsp; Both table share a key field (Key!) why am I getting duplicate rows?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jan 2016 14:29:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Confused-with-join/m-p/1097308#M18445</guid>
      <dc:creator />
      <dc:date>2016-01-15T14:29:05Z</dc:date>
    </item>
    <item>
      <title>Re: Confused with join</title>
      <link>https://community.qlik.com/t5/App-Development/Confused-with-join/m-p/1097309#M18446</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;because the common field, used in the join, is Key and, a join &lt;SPAN style="font-family: sans-serif; font-size: 14px;"&gt;is used for combining &lt;/SPAN&gt;&lt;A href="https://en.wikipedia.org/wiki/Field_(computer_science)" style="color: #0b0080; font-family: sans-serif; font-size: 14px; background: none #ffffff;" title="Field (computer science)"&gt;&lt;SPAN style="color: #000000;"&gt;fields&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 14px; font-family: sans-serif;"&gt; from two tables (or more) by using values common to each&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for every A in the first table, with the join you get 3 rows in the second table --&amp;gt; 9 rows&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try this if you only want 3 rows &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Table1:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Load&amp;nbsp; * Inline [&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Key, Column1 , Column2&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;A,1,4&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;AA,2,5&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;AAA,3,6&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;];&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Table2:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Load&amp;nbsp; * Inline [&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Key, Column3, Column4&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;A,11,44&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;AA,22,55&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;AAA,33,66&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;];&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;inner Join (Table1)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Load&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;*&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Resident Table2;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Drop table Table2;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="1.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/111769_1.png" style="height: auto; width: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jan 2016 18:03:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Confused-with-join/m-p/1097309#M18446</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2016-01-15T18:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: Confused with join</title>
      <link>https://community.qlik.com/t5/App-Development/Confused-with-join/m-p/1097310#M18447</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The default join is the inner join. It combines each key with values equals in the other table.&lt;/P&gt;&lt;P&gt;As maxgro said you need to have diferent values for each key value. If you don't you obtain a cartesian join because each value in&amp;nbsp; the first table combines with all values in the second.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jan 2016 19:26:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Confused-with-join/m-p/1097310#M18447</guid>
      <dc:creator>gferran</dc:creator>
      <dc:date>2016-01-15T19:26:03Z</dc:date>
    </item>
    <item>
      <title>Re: Confused with join</title>
      <link>https://community.qlik.com/t5/App-Development/Confused-with-join/m-p/1097311#M18448</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks maxgro that's helped solidify it in my mind.&amp;nbsp; The data in the field must be unique.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've checked my app and it is (in principle) unique.&amp;nbsp;&amp;nbsp; The common field across both tables I'm trying to join is a combination of emplid and date that is returning duplicates. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, it turns out that the data quality is an issue (there are some unintentional overlapping dates) meaning the field isn't actually unique at all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks once again&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jan 2016 19:51:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Confused-with-join/m-p/1097311#M18448</guid>
      <dc:creator />
      <dc:date>2016-01-15T19:51:37Z</dc:date>
    </item>
    <item>
      <title>Re: Confused with join</title>
      <link>https://community.qlik.com/t5/App-Development/Confused-with-join/m-p/1097312#M18449</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;AFAIK the default join in Qlik is the outer because, below is from the Qlik help, the outer is optional&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;The explicit &lt;A class="MCXref_0"&gt;Join&lt;/A&gt; prefix can be preceded by the prefix &lt;SPAN class="Bold"&gt;outer&lt;/SPAN&gt; in order to specify an outer join. In an outer join all combinations between the two tables are generated. The resulting table will thus contain combinations of field values from the raw data tables where the linking field values are represented in one or both tables. &lt;STRONG&gt;The &lt;SPAN class="Bold"&gt;outer&lt;/SPAN&gt; keyword is optional. &lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P class="syntax"&gt;&lt;EM&gt;&lt;SPAN class="Bold"&gt;outer join&lt;/SPAN&gt; [ &lt;SPAN class="Bold"&gt;(&lt;/SPAN&gt;tablename &lt;SPAN class="Bold"&gt;)&lt;/SPAN&gt;&lt;SPAN class="Italic"&gt; ](loadstatement |selectstatement )&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jan 2016 20:04:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Confused-with-join/m-p/1097312#M18449</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2016-01-15T20:04:19Z</dc:date>
    </item>
  </channel>
</rss>

