<?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 LEFT JOIN - LEFT KEEP - ASSOCIATION in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/LEFT-JOIN-LEFT-KEEP-ASSOCIATION/m-p/402867#M149897</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I have two table (1:n), I want to join it. The first table contains the "balance" (1 for key) the second table contains the movements (n for key)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) f I use &lt;STRONG&gt;LEFT JOIN&lt;/STRONG&gt;, I have the field SALDO multiplied&amp;nbsp; for the n-movements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="294"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" width="98"&gt;OWNER&lt;/TD&gt;&lt;TD class="xl64" width="98"&gt;SUM(SALDO)&lt;BR /&gt; &lt;/TD&gt;&lt;TD class="xl64" style="border-left: none;" width="98"&gt;SUM(MOV)&lt;BR /&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;XYZ&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;9000&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;1900&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;XYT&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;3000&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;500&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;XYR&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;-2000&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Instead, if&amp;nbsp; I use &lt;STRONG&gt;LEFT KEEP,&lt;/STRONG&gt; or if &lt;STRONG&gt;I don't write any JOIN&lt;/STRONG&gt;, working with two table in association,&amp;nbsp;&amp;nbsp; the filed SALDO is correct (not multiplicated by n-movements)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 294px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" width="98"&gt;OWNER&lt;/TD&gt;&lt;TD class="xl64" width="98"&gt;SUM(SALDO)&lt;BR /&gt; &lt;/TD&gt;&lt;TD class="xl64" style="border-left: none;" width="98"&gt;SUM(MOV)&lt;BR /&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;XYZ&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;3000&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;1900&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;XYT&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;3000&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;500&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;XYR&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;-2000&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could someone explain to me in detail why?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you &lt;/P&gt;&lt;P&gt;Andrea &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;---------&lt;/P&gt;&lt;P&gt;TAB_SALDI:&lt;/P&gt;&lt;P&gt;Load &lt;/P&gt;&lt;P&gt;CONTO AS CONTO_KEY,&lt;/P&gt;&lt;P&gt;CONTO,&lt;/P&gt;&lt;P&gt;DIV,&lt;/P&gt;&lt;P&gt;OWNER,&lt;/P&gt;&lt;P&gt;SALDO&lt;/P&gt;&lt;P&gt;Inline&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;CONTO,OWNER,DIV,SALDO&lt;/P&gt;&lt;P&gt;10001EUR,XYZ,EUR,1000&lt;/P&gt;&lt;P&gt;10002EUR,XYZ,EUR,2000&lt;/P&gt;&lt;P&gt;10003USD,XYT,USD,3000&lt;/P&gt;&lt;P&gt;10004USD,XYR,USD,-2000&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LEFT JOIN (TAB_SALDI)&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #3366ff;"&gt; // LEFT KEEP (TAB_SALDI)&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TAB_MOV:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;CONTO AS CONTO_KEY,&lt;/P&gt;&lt;P&gt;ID,&lt;/P&gt;&lt;P&gt;MOV&lt;/P&gt;&lt;P&gt;inline&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;CONTO,ID,MOV&lt;/P&gt;&lt;P&gt;10001EUR,1,200&lt;/P&gt;&lt;P&gt;10001EUR,2,100&lt;/P&gt;&lt;P&gt;10001EUR,3,600&lt;/P&gt;&lt;P&gt;10002EUR,1,200&lt;/P&gt;&lt;P&gt;10002EUR,2,300&lt;/P&gt;&lt;P&gt;10002EUR,3,500&lt;/P&gt;&lt;P&gt;10003USD,1,500&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 05 Nov 2012 15:46:02 GMT</pubDate>
    <dc:creator>andrew001</dc:creator>
    <dc:date>2012-11-05T15:46:02Z</dc:date>
    <item>
      <title>LEFT JOIN - LEFT KEEP - ASSOCIATION</title>
      <link>https://community.qlik.com/t5/QlikView/LEFT-JOIN-LEFT-KEEP-ASSOCIATION/m-p/402867#M149897</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I have two table (1:n), I want to join it. The first table contains the "balance" (1 for key) the second table contains the movements (n for key)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) f I use &lt;STRONG&gt;LEFT JOIN&lt;/STRONG&gt;, I have the field SALDO multiplied&amp;nbsp; for the n-movements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="294"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" width="98"&gt;OWNER&lt;/TD&gt;&lt;TD class="xl64" width="98"&gt;SUM(SALDO)&lt;BR /&gt; &lt;/TD&gt;&lt;TD class="xl64" style="border-left: none;" width="98"&gt;SUM(MOV)&lt;BR /&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;XYZ&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;9000&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;1900&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;XYT&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;3000&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;500&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;XYR&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;-2000&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Instead, if&amp;nbsp; I use &lt;STRONG&gt;LEFT KEEP,&lt;/STRONG&gt; or if &lt;STRONG&gt;I don't write any JOIN&lt;/STRONG&gt;, working with two table in association,&amp;nbsp;&amp;nbsp; the filed SALDO is correct (not multiplicated by n-movements)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 294px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" width="98"&gt;OWNER&lt;/TD&gt;&lt;TD class="xl64" width="98"&gt;SUM(SALDO)&lt;BR /&gt; &lt;/TD&gt;&lt;TD class="xl64" style="border-left: none;" width="98"&gt;SUM(MOV)&lt;BR /&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;XYZ&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;3000&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;1900&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;XYT&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;3000&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;500&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;XYR&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;-2000&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could someone explain to me in detail why?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you &lt;/P&gt;&lt;P&gt;Andrea &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;---------&lt;/P&gt;&lt;P&gt;TAB_SALDI:&lt;/P&gt;&lt;P&gt;Load &lt;/P&gt;&lt;P&gt;CONTO AS CONTO_KEY,&lt;/P&gt;&lt;P&gt;CONTO,&lt;/P&gt;&lt;P&gt;DIV,&lt;/P&gt;&lt;P&gt;OWNER,&lt;/P&gt;&lt;P&gt;SALDO&lt;/P&gt;&lt;P&gt;Inline&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;CONTO,OWNER,DIV,SALDO&lt;/P&gt;&lt;P&gt;10001EUR,XYZ,EUR,1000&lt;/P&gt;&lt;P&gt;10002EUR,XYZ,EUR,2000&lt;/P&gt;&lt;P&gt;10003USD,XYT,USD,3000&lt;/P&gt;&lt;P&gt;10004USD,XYR,USD,-2000&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LEFT JOIN (TAB_SALDI)&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #3366ff;"&gt; // LEFT KEEP (TAB_SALDI)&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TAB_MOV:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;CONTO AS CONTO_KEY,&lt;/P&gt;&lt;P&gt;ID,&lt;/P&gt;&lt;P&gt;MOV&lt;/P&gt;&lt;P&gt;inline&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;CONTO,ID,MOV&lt;/P&gt;&lt;P&gt;10001EUR,1,200&lt;/P&gt;&lt;P&gt;10001EUR,2,100&lt;/P&gt;&lt;P&gt;10001EUR,3,600&lt;/P&gt;&lt;P&gt;10002EUR,1,200&lt;/P&gt;&lt;P&gt;10002EUR,2,300&lt;/P&gt;&lt;P&gt;10002EUR,3,500&lt;/P&gt;&lt;P&gt;10003USD,1,500&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Nov 2012 15:46:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/LEFT-JOIN-LEFT-KEEP-ASSOCIATION/m-p/402867#M149897</guid>
      <dc:creator>andrew001</dc:creator>
      <dc:date>2012-11-05T15:46:02Z</dc:date>
    </item>
    <item>
      <title>Re: LEFT JOIN - LEFT KEEP - ASSOCIATION</title>
      <link>https://community.qlik.com/t5/QlikView/LEFT-JOIN-LEFT-KEEP-ASSOCIATION/m-p/402868#M149898</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;Imagine that you have both tables in Excel.&lt;/P&gt;&lt;P&gt;1) With this approach you construct common table, duplicating the rows from 'balance' table.&lt;/P&gt;&lt;P&gt;As you see, your saldo is copied n-times. As a result the sum is n-times higher.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Here you dont copy rows, you lookup for the values to 'balance table or to 'movement' table.&lt;/P&gt;&lt;P&gt;The sum is calculated correctly as you don't copy the rows.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Nov 2012 16:50:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/LEFT-JOIN-LEFT-KEEP-ASSOCIATION/m-p/402868#M149898</guid>
      <dc:creator>whiteline</dc:creator>
      <dc:date>2012-11-05T16:50:04Z</dc:date>
    </item>
  </channel>
</rss>

