<?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: Join Conundrum in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Join-Conundrum/m-p/706937#M1056998</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not understood your exact requirements... Can you please elaborate little more?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Oct 2014 11:13:37 GMT</pubDate>
    <dc:creator>MK_QSL</dc:creator>
    <dc:date>2014-10-11T11:13:37Z</dc:date>
    <item>
      <title>Join Conundrum</title>
      <link>https://community.qlik.com/t5/QlikView/Join-Conundrum/m-p/706936#M1056997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi - this is my first post and am I just getting into the QlikView world!!!&amp;nbsp; Just exploring what I can do with this to help reconcile some project numbers based on existing files.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am a little confused as to why why join is essentially doubling my test file.&amp;nbsp; I have two tables, tmpData and Mkt_Filt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both tables have a common field - &lt;STRONG&gt;Mkt_Cd&lt;/STRONG&gt;, and both have the 5100 and 5336 values, but when I join the two resident tables, it doubles the transactions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My tmpData table has the following relevent fields:&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;&lt;STRONG&gt;Mkt_Cd&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Mkt_Desc&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Yr&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;MonthText&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;GBPVal&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;5100&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;GB&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2014&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;@1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;10000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;5336&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Ireland&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2014&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;@1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3000&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My Mkt_Filt table has:&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;&lt;STRONG&gt;Mkt_Cd&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Start_Date&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;5100&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;01/01/2014&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;5336&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;01/06/2014&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Target Final Table&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;Mkt_Cd&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Start_Date (from Mkt_Filt)&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;GBPVal&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;5100&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;01/01/2014&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;10000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;5336&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;01/06/2014&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3000&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I get - both dates showin but only 1 is relevent to the particular market.&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;&lt;STRONG&gt;Mkt_Cd&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Start_Date&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;GBPVal&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;5100&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;01/01/2014&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;10000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;5100&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;01/06/2014&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;10000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;5336&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;01/01/2014&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;5336&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;01/06/2014&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3000&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be appreciated.&amp;nbsp; I have uploaded my qvw and the initial spreadsheet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Les&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Oct 2014 10:59:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-Conundrum/m-p/706936#M1056997</guid>
      <dc:creator />
      <dc:date>2014-10-11T10:59:59Z</dc:date>
    </item>
    <item>
      <title>Re: Join Conundrum</title>
      <link>https://community.qlik.com/t5/QlikView/Join-Conundrum/m-p/706937#M1056998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not understood your exact requirements... Can you please elaborate little more?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Oct 2014 11:13:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-Conundrum/m-p/706937#M1056998</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2014-10-11T11:13:37Z</dc:date>
    </item>
    <item>
      <title>Re: Join Conundrum</title>
      <link>https://community.qlik.com/t5/QlikView/Join-Conundrum/m-p/706938#M1056999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, basically why does the Start_Date 01/06/2014 show up against Mkt_Cd 5100, when it is only relevent to 5336, and vice versa, why does the Start_Date 01/01/2014 show against Mkt_Cd 5336 when it is only valid for 5100.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am expecting the 3rd table above to be my final table, not the 4th table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Les&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Oct 2014 11:25:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-Conundrum/m-p/706938#M1056999</guid>
      <dc:creator />
      <dc:date>2014-10-11T11:25:10Z</dc:date>
    </item>
    <item>
      <title>Re: Join Conundrum</title>
      <link>https://community.qlik.com/t5/QlikView/Join-Conundrum/m-p/706939#M1057000</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;your data will double when the table you join has values which are not distinct. For example you have two occurences of 5100 in the table you join, then you will also get 2 occurences in the table you joined the former table. You could try load distinct on the table you want to join.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible that the two fields on which the join is performed have different names? This would cause a carthesian product and that is what your results look like.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Oct 2014 11:27:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-Conundrum/m-p/706939#M1057000</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-10-11T11:27:54Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Join Conundrum</title>
      <link>https://community.qlik.com/t5/QlikView/Join-Conundrum/m-p/706940#M1057001</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi - Sorry I was called away.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Mkt_Filt table only has the two entries - the Mkt_Cd being unique.&amp;nbsp; The fields look exactly the same to me - same case, same spelling.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you see anything wrong with this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Directory;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;// Bring in Mkt_Filt table - this only has 2 lines - Mkt_Cd is unique&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Mkt_Filt:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;LOAD&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Mkt_Cd,&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Start_Date&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;FROM&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;[2014_crosstable.xlsx]&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;(ooxml, embedded labels, table is Sheet2);&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;//&amp;nbsp; Bring in Cross table - &lt;STRONG&gt;&lt;EM&gt;- this only has 2 lines - Mkt_Cd is unique, and matches values in Mkt_Filt table&lt;/EM&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;tmpData:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Crosstable (MonthText,GBPVal,4)&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Load Mkt_Cd,Mkt_Description,Measure,Left(FileName(),4) as Yr,@6,@7,@8,@9,@10,@11,@12,@13,@14,@15,@16,@17&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;FROM [2014_crosstable.xlsx]&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;(ooxml, embedded labels, table is Sheet1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;// Make changes to imported crosstable - specifically Mth and TranDate&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;tmpData2:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Load&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Mkt_Cd,&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Measure,&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Yr,&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Replace(MonthText,'@','')-5 as Mth,&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MakeDate(Yr,Replace(MonthText,'@','')-5,1) as TranDate,&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GBPVal&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Resident tmpData;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;// Drop initial tmp table&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Drop Table tmpData;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #ff0000;"&gt;&lt;EM&gt;// Bring in start_date to tmpData2 table - basically just want to add the Start_Date field to the tmpData2 table&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;STRONG&gt;INNER JOIN (tmpData2)&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;STRONG&gt;Load Start_Date&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;STRONG&gt;Resident Mkt_Filt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;// Drop Mkt_Filt table&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;drop table Mkt_Filt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks Les&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Oct 2014 13:19:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-Conundrum/m-p/706940#M1057001</guid>
      <dc:creator />
      <dc:date>2014-10-11T13:19:27Z</dc:date>
    </item>
    <item>
      <title>Re: Join Conundrum</title>
      <link>https://community.qlik.com/t5/QlikView/Join-Conundrum/m-p/706941#M1057002</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;in your inner join you are missing&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Mkt_Cd,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;this causes the carthesian product of both tables. So your load statement should look like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;STRONG&gt;INNER JOIN (tmpData2)&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;STRONG&gt;Load &lt;/STRONG&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;STRONG&gt;Mkt_Cd,&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;STRONG&gt;Start_Date&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;STRONG&gt;Resident Mkt_Filt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Oct 2014 13:47:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-Conundrum/m-p/706941#M1057002</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-10-11T13:47:15Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Join Conundrum</title>
      <link>https://community.qlik.com/t5/QlikView/Join-Conundrum/m-p/706942#M1057003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stefan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for that.&amp;nbsp; Perfectly correct.&amp;nbsp; I didn't think I needed to add the Mkt_Cd.&amp;nbsp; Learn a little every day.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Oct 2014 13:50:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-Conundrum/m-p/706942#M1057003</guid>
      <dc:creator />
      <dc:date>2014-10-11T13:50:57Z</dc:date>
    </item>
  </channel>
</rss>

