<?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 Outer Join Problems in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Outer-Join-Problems/m-p/276848#M1205243</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for you help John.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Sep 2010 19:16:21 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-09-15T19:16:21Z</dc:date>
    <item>
      <title>Outer Join Problems</title>
      <link>https://community.qlik.com/t5/QlikView/Outer-Join-Problems/m-p/276846#M1205241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;This is a follow-up question from: http://community.qlik.com/forums/t/33999.aspx&lt;/P&gt;&lt;P&gt;I realized after all that was said and done, I realized I needed another column in there. A here's a brief look at what it looked like originally:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Taxonomy Category DoS to DoOS DoOS to Do1NA Do1NA to Do1O ....etc&lt;/P&gt;&lt;P&gt;Cardiology 2 1 3 ....etc&lt;/P&gt;&lt;P&gt;Ophthalmology 1 3 6 ...etc&lt;/P&gt;&lt;P&gt;Orthopedics 6 8 9 ....etc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What it should've been when it was transformed:&lt;/P&gt;&lt;P&gt;Variables Days Taxonomy Category&lt;/P&gt;&lt;P&gt;DoS to DoOS 2 Cardiology&lt;/P&gt;&lt;P&gt;DoS to DoOS 1 Ophthalmology&lt;/P&gt;&lt;P&gt;DoS to DoOS 6 Orthopedics&lt;/P&gt;&lt;P&gt;DoOS to Do1NA 1 Cardiology&lt;/P&gt;&lt;P&gt;DoOS to Do1NA 3 Ophthalmology&lt;/P&gt;&lt;P&gt;DoOS to Do1NA 8 Orthopedics&lt;/P&gt;&lt;P&gt;Do1NA to Do1O 3 Cardiology&lt;/P&gt;&lt;P&gt;Do1NA to Do1O 6 Ophthalmology&lt;/P&gt;&lt;P&gt;Do1NA to Do1O 9 Orthopedics&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's the code i've been tinkering with in an attempt to just add the column onto the first with it's ID key:&lt;/P&gt;&lt;P&gt;DaysTable:&lt;BR /&gt;CROSSTABLE (TimeFrame, Days)&lt;BR /&gt;LOAD recno() as ID,&lt;BR /&gt; [DoS to DoOS],&lt;BR /&gt; [DoOS to Do1NA],&lt;BR /&gt; [Do1NA to Do1O],&lt;BR /&gt; [Do1O to Do1PA],&lt;BR /&gt; [DoS to D1RAR],&lt;BR /&gt; [Do1PA to D1RAR],&lt;BR /&gt; [DoS to Do1CI]&lt;BR /&gt;Resident Lag;&lt;BR /&gt;&lt;BR /&gt;TaxTable:&lt;BR /&gt;CROSSTABLE (TaxCat,Count)&lt;BR /&gt;Load recno() as ID,&lt;BR /&gt; [Taxonomy Category]&lt;BR /&gt;Resident Lag;&lt;BR /&gt;&lt;BR /&gt;Try:&lt;BR /&gt;ADD&lt;BR /&gt;Load * Resident Lag;&lt;BR /&gt;Outer Join Load * Resident TaxTable;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I load the data, here's what the script executioner says:&lt;/P&gt;&lt;P&gt;Lag &amp;lt;&amp;lt; Lag 308,352 lines fetched&lt;BR /&gt;DaysTable &amp;lt;&amp;lt; Lag 2,006,597 lines fetched&lt;BR /&gt;Lag &amp;lt;&amp;lt; Lag 308,352 lines fetched&lt;BR /&gt;TaxTable &amp;lt;&amp;lt; Lag 308,352 lines fetched&lt;BR /&gt;Lag &amp;lt;&amp;lt; Lag 616,704 lines fetched *Wrong&lt;BR /&gt;Try &amp;lt;&amp;lt; TaxTable 308,352 lines fetched *Wrong&lt;BR /&gt;$Syn 1 = Taxonomy+Taxonomy Category&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Lag table should continue to have 308,352 entries, and the try table should have the same number of lines as the DaysTable (2,006,597).&lt;/P&gt;&lt;P&gt;Ideally, what I probably should have done, was have the [Taxonomy code] Loaded with the DaysTable and avoid the merge altogether.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea what's going wrong and how can I fix it?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Sep 2010 18:27:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Outer-Join-Problems/m-p/276846#M1205241</guid>
      <dc:creator />
      <dc:date>2010-09-15T18:27:15Z</dc:date>
    </item>
    <item>
      <title>Outer Join Problems</title>
      <link>https://community.qlik.com/t5/QlikView/Outer-Join-Problems/m-p/276847#M1205242</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The ID being generated is the recno() of the OUTPUT table in each case, not the record number of the Lag table itself. So in the DaysTable, you have 2,006,597 IDs, while in the TaxTable you only have 308,352 IDs. Therefore, when you outer join them, you're joining to only the first 308,352 records in the DaysTable, and they're the wrong records - just whatever happens to come first. (Edit: I think I got that a little wrong. The outer join would have worked fine, as it would have joined by Taxonomy Category. But then the resulting data model would associate the wrong Taxonomy categories with the data in the DaysTable because of the way the IDs don't line up. Same bad result, but slightly different process to get there.)&lt;/P&gt;&lt;P&gt;The solution is to include the Taxonomy Category in the original load, as you said, and avoid the merge altogether. That just takes an additional parameter in the crosstable() to tell it that you have TWO fields (instead of the default of one) that come before the data it should switch from columns to rows. Like this:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;DaysTable:&lt;BR /&gt;CROSSTABLE (TimeFrame, Days&lt;STRONG&gt;, 2&lt;/STRONG&gt;)&lt;BR /&gt;LOAD recno() as ID,&lt;BR /&gt; &lt;STRONG&gt;[Taxonomy Category],&lt;/STRONG&gt;&lt;BR /&gt; [DoS to DoOS],&lt;BR /&gt; [DoOS to Do1NA],&lt;BR /&gt; [Do1NA to Do1O],&lt;BR /&gt; [Do1O to Do1PA],&lt;BR /&gt; [DoS to D1RAR],&lt;BR /&gt; [Do1PA to D1RAR],&lt;BR /&gt; [DoS to Do1CI]&lt;BR /&gt;Resident Lag;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Sep 2010 18:58:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Outer-Join-Problems/m-p/276847#M1205242</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-09-15T18:58:17Z</dc:date>
    </item>
    <item>
      <title>Outer Join Problems</title>
      <link>https://community.qlik.com/t5/QlikView/Outer-Join-Problems/m-p/276848#M1205243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for you help John.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Sep 2010 19:16:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Outer-Join-Problems/m-p/276848#M1205243</guid>
      <dc:creator />
      <dc:date>2010-09-15T19:16:21Z</dc:date>
    </item>
  </channel>
</rss>

