<?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 problem; Sum in the where clause in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Join-problem-Sum-in-the-where-clause/m-p/620269#M681652</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;left join (relations)&lt;/P&gt;&lt;P&gt;load leftkey2,rightkey2,sumdocs&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;k:&lt;/P&gt;&lt;P&gt;load distinct&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; relkey, fistvalue(tmp_rkey) as leftkey2,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; firstvalue(tmp_skey)as Rightkey2, sum(docs) as sumdocs&lt;/P&gt;&lt;P&gt;resident relations&lt;/P&gt;&lt;P&gt;group by relkey;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;left join(relatins)&lt;/P&gt;&lt;P&gt;load leftkey2,rightkey2,sumdocs resident k where sumdocs &amp;gt;0;&lt;/P&gt;&lt;P&gt;drop table k;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 09 Apr 2014 14:04:18 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-04-09T14:04:18Z</dc:date>
    <item>
      <title>Join problem; Sum in the where clause</title>
      <link>https://community.qlik.com/t5/QlikView/Join-problem-Sum-in-the-where-clause/m-p/620268#M681651</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ideas why the join below does not work?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suspect that I cannot use sum in the where clause, but hopefully I am wrong and there is another explanation. Would appreciate any hints!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left join(Relations) LOAD Distinct&lt;/P&gt;&lt;P&gt;&amp;nbsp; relKey,&lt;/P&gt;&lt;P&gt;&amp;nbsp; FirstValue(tmp_rKey) as LeftKey2,&lt;/P&gt;&lt;P&gt;&amp;nbsp; FirstValue(tmp_sKey) as RightKey2&lt;/P&gt;&lt;P&gt;Resident Relations&lt;/P&gt;&lt;P&gt;where sum(docs) = 0&lt;/P&gt;&lt;P&gt;group by relKey;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Apr 2014 13:58:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-problem-Sum-in-the-where-clause/m-p/620268#M681651</guid>
      <dc:creator>Christian_Lauritzen</dc:creator>
      <dc:date>2014-04-09T13:58:01Z</dc:date>
    </item>
    <item>
      <title>Re: Join problem; Sum in the where clause</title>
      <link>https://community.qlik.com/t5/QlikView/Join-problem-Sum-in-the-where-clause/m-p/620269#M681652</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;left join (relations)&lt;/P&gt;&lt;P&gt;load leftkey2,rightkey2,sumdocs&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;k:&lt;/P&gt;&lt;P&gt;load distinct&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; relkey, fistvalue(tmp_rkey) as leftkey2,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; firstvalue(tmp_skey)as Rightkey2, sum(docs) as sumdocs&lt;/P&gt;&lt;P&gt;resident relations&lt;/P&gt;&lt;P&gt;group by relkey;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;left join(relatins)&lt;/P&gt;&lt;P&gt;load leftkey2,rightkey2,sumdocs resident k where sumdocs &amp;gt;0;&lt;/P&gt;&lt;P&gt;drop table k;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Apr 2014 14:04:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-problem-Sum-in-the-where-clause/m-p/620269#M681652</guid>
      <dc:creator />
      <dc:date>2014-04-09T14:04:18Z</dc:date>
    </item>
    <item>
      <title>Re: Join problem; Sum in the where clause</title>
      <link>https://community.qlik.com/t5/QlikView/Join-problem-Sum-in-the-where-clause/m-p/620270#M681653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Solved it by moving the sum condition to an if-clause on the line;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(sum(docs)&amp;gt;0,tmp_rKey) as LeftKey2&amp;nbsp;&amp;nbsp;&amp;nbsp; ... etc&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Apr 2014 14:06:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-problem-Sum-in-the-where-clause/m-p/620270#M681653</guid>
      <dc:creator>Christian_Lauritzen</dc:creator>
      <dc:date>2014-04-09T14:06:42Z</dc:date>
    </item>
  </channel>
</rss>

