<?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 Issue with join key (full outer join) - Optimization in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Issue-with-join-key-full-outer-join-Optimization/m-p/795773#M533533</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to optimize my data model by minimizing the # of columns used, especially the columns with a lot of distinct values.&lt;/P&gt;&lt;P&gt;I have a scenario where, there are two tables associated with a key column say &lt;STRONG&gt;key1.&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;Now, QlikView by default creates a full outer join, and the join column holds &lt;STRONG&gt;all the distinct values from the two tables combined&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;Is there any way i can count the distinct values from any one of the two tables using the same join key &lt;STRONG&gt;key1&lt;/STRONG&gt;?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently, i have to create a copy of the key1 in both the tables (which is not used for joining) for the counts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know what is recommended and if my approach is correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Diwakar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Mar 2015 19:53:13 GMT</pubDate>
    <dc:creator>diwakarnahata</dc:creator>
    <dc:date>2015-03-12T19:53:13Z</dc:date>
    <item>
      <title>Issue with join key (full outer join) - Optimization</title>
      <link>https://community.qlik.com/t5/QlikView/Issue-with-join-key-full-outer-join-Optimization/m-p/795773#M533533</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to optimize my data model by minimizing the # of columns used, especially the columns with a lot of distinct values.&lt;/P&gt;&lt;P&gt;I have a scenario where, there are two tables associated with a key column say &lt;STRONG&gt;key1.&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;Now, QlikView by default creates a full outer join, and the join column holds &lt;STRONG&gt;all the distinct values from the two tables combined&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;Is there any way i can count the distinct values from any one of the two tables using the same join key &lt;STRONG&gt;key1&lt;/STRONG&gt;?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently, i have to create a copy of the key1 in both the tables (which is not used for joining) for the counts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know what is recommended and if my approach is correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Diwakar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Mar 2015 19:53:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Issue-with-join-key-full-outer-join-Optimization/m-p/795773#M533533</guid>
      <dc:creator>diwakarnahata</dc:creator>
      <dc:date>2015-03-12T19:53:13Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with join key (full outer join) - Optimization</title>
      <link>https://community.qlik.com/t5/QlikView/Issue-with-join-key-full-outer-join-Optimization/m-p/795774#M533534</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If there is a column which is unique to each of its respective tables and it is available throughout the table, then you can use that to do a distinct count. For instance if Table 1 has a column name city which is not in Table 2. Then within your text object you can write this expression: &lt;STRONG&gt;=Count(DISTINCT {&amp;lt;city = {'*?'}&amp;gt;} key1). &lt;/STRONG&gt;This will only count places where city is not blank, which is available in your Table 1 only. (Table 2 will have it all blank)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also create your flag for each of the table in the script and use that flag in your set analysis statement (more efficient way to do it, but require manipulation in the script itself)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Table1:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD xyz,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; key1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 as Flag1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FROM xyz;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Table2:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD zzz,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; key1,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 as Flag2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FROM zzz;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression for count: &lt;STRONG&gt;=Count(DISTINCT {&amp;lt;Flag1 = {1}&amp;gt;}) key1) &lt;/STRONG&gt;- &amp;gt; will give you distinct count of key1 from Table1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG style="font-size: 13.3333330154419px;"&gt;=Count(DISTINCT {&amp;lt;Flag2 = {1}&amp;gt;}) key1) &lt;/STRONG&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;- &amp;gt; will give you distinct count of key1 from Table2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;S&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Mar 2015 20:12:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Issue-with-join-key-full-outer-join-Optimization/m-p/795774#M533534</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-03-12T20:12:40Z</dc:date>
    </item>
  </channel>
</rss>

