<?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 Question - Eliminate Duplicate Values in Sum in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Join-Question-Eliminate-Duplicate-Values-in-Sum/m-p/446076#M166405</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum(aggr(Number,Index))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 23 Oct 2012 19:40:53 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2012-10-23T19:40:53Z</dc:date>
    <item>
      <title>Join Question - Eliminate Duplicate Values in Sum</title>
      <link>https://community.qlik.com/t5/QlikView/Join-Question-Eliminate-Duplicate-Values-in-Sum/m-p/446072#M166401</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Quick (I hope) question.&amp;nbsp;&amp;nbsp; For the load script below, I need to join 2 tables and have the value in "Number" NOT get duplicated.&amp;nbsp;&amp;nbsp; Is there a way to do this?&lt;/P&gt;&lt;P&gt;Currently the Number column gets duplicated for due whenever there is more than 1 row in the second table.&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Desired results would be for there to only be one number 2 on Bob, index 1, instead of two number 2's as in the results below.&amp;nbsp; So in an expression, I need to sum the distinct Number column, which works if you incorporate Index somehow, so maybe the answer is the somehow write the sum to include Index without altering the output of the expression?&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attached is this test scenario.&amp;nbsp;&amp;nbsp; Hope this is easy.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks much!&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="23952" class="jive-image" alt="script.PNG" src="https://community.qlik.com/legacyfs/online/23952_script.PNG" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="23953" class="jive-image" alt="result.PNG" src="https://community.qlik.com/legacyfs/online/23953_result.PNG" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2012 19:28:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-Question-Eliminate-Duplicate-Values-in-Sum/m-p/446072#M166401</guid>
      <dc:creator />
      <dc:date>2012-10-23T19:28:54Z</dc:date>
    </item>
    <item>
      <title>Re: Join Question - Eliminate Duplicate Values in Sum</title>
      <link>https://community.qlik.com/t5/QlikView/Join-Question-Eliminate-Duplicate-Values-in-Sum/m-p/446073#M166402</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you only want one record for Bob, do you want to see AnyNumber 10 or 14?&amp;nbsp; For example, do you only want the max value? The min? The one to many relationship is causing your multiple records.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2012 19:35:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-Question-Eliminate-Duplicate-Values-in-Sum/m-p/446073#M166402</guid>
      <dc:creator />
      <dc:date>2012-10-23T19:35:29Z</dc:date>
    </item>
    <item>
      <title>Re: Join Question - Eliminate Duplicate Values in Sum</title>
      <link>https://community.qlik.com/t5/QlikView/Join-Question-Eliminate-Duplicate-Values-in-Sum/m-p/446074#M166403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to Sum(Number) for Bob, and have the answer be 9.&amp;nbsp;&amp;nbsp; Currently it is 11 because of the duplicates.&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2012 19:37:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-Question-Eliminate-Duplicate-Values-in-Sum/m-p/446074#M166403</guid>
      <dc:creator />
      <dc:date>2012-10-23T19:37:14Z</dc:date>
    </item>
    <item>
      <title>Re: Join Question - Eliminate Duplicate Values in Sum</title>
      <link>https://community.qlik.com/t5/QlikView/Join-Question-Eliminate-Duplicate-Values-in-Sum/m-p/446075#M166404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm unclear.&amp;nbsp; Did you want to sum AnyNumber?&amp;nbsp; In a chart:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Dimensions: Index, Number, Person&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Expression: sum(AnyNumber)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In script, something like this replacing your second load:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;OUTER JOIN (Table1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD Index, sum(AnyNum) as AnyNum&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;INLINE [&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;...&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;Edit:&amp;nbsp; OK, that's not what you want, though I still don't know what you DO want.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2012 19:37:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-Question-Eliminate-Duplicate-Values-in-Sum/m-p/446075#M166404</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2012-10-23T19:37:50Z</dc:date>
    </item>
    <item>
      <title>Re: Join Question - Eliminate Duplicate Values in Sum</title>
      <link>https://community.qlik.com/t5/QlikView/Join-Question-Eliminate-Duplicate-Values-in-Sum/m-p/446076#M166405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum(aggr(Number,Index))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2012 19:40:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-Question-Eliminate-Duplicate-Values-in-Sum/m-p/446076#M166405</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-10-23T19:40:53Z</dc:date>
    </item>
    <item>
      <title>Re: Join Question - Eliminate Duplicate Values in Sum</title>
      <link>https://community.qlik.com/t5/QlikView/Join-Question-Eliminate-Duplicate-Values-in-Sum/m-p/446077#M166406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It sounds like you just want to skip the outer join.&amp;nbsp; If you don't join, it won't duplicate the row, and if you make a chart of Person and sum(Number), you'll get 9 for Bob.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2012 19:41:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-Question-Eliminate-Duplicate-Values-in-Sum/m-p/446077#M166406</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2012-10-23T19:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: Join Question - Eliminate Duplicate Values in Sum</title>
      <link>https://community.qlik.com/t5/QlikView/Join-Question-Eliminate-Duplicate-Values-in-Sum/m-p/446078#M166407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortuntately the join is needed due to index issues, but I hear you, I wish i could!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2012 19:45:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-Question-Eliminate-Duplicate-Values-in-Sum/m-p/446078#M166407</guid>
      <dc:creator />
      <dc:date>2012-10-23T19:45:51Z</dc:date>
    </item>
    <item>
      <title>Re: Join Question - Eliminate Duplicate Values in Sum</title>
      <link>https://community.qlik.com/t5/QlikView/Join-Question-Eliminate-Duplicate-Values-in-Sum/m-p/446079#M166408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, I just created a chart with Person as the dimension and tried this expression: &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;=&lt;SPAN style="color: #0000ff;"&gt;sum&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;Aggr&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Number&lt;/SPAN&gt;,&lt;SPAN style="color: #800000;"&gt;Person&lt;/SPAN&gt;)) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;But it didn't work.&amp;nbsp;&amp;nbsp; What do I need to change?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2012 19:47:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-Question-Eliminate-Duplicate-Values-in-Sum/m-p/446079#M166408</guid>
      <dc:creator />
      <dc:date>2012-10-23T19:47:32Z</dc:date>
    </item>
    <item>
      <title>Re: Join Question - Eliminate Duplicate Values in Sum</title>
      <link>https://community.qlik.com/t5/QlikView/Join-Question-Eliminate-Duplicate-Values-in-Sum/m-p/446080#M166409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The expression uses Index, not Person.&amp;nbsp; Check what he wrote again, and copy it exactly.&amp;nbsp; It should work as long as the Index is uniquely identifying rows in the original table, pre-duplication.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2012 19:50:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-Question-Eliminate-Duplicate-Values-in-Sum/m-p/446080#M166409</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2012-10-23T19:50:52Z</dc:date>
    </item>
    <item>
      <title>Re: Join Question - Eliminate Duplicate Values in Sum</title>
      <link>https://community.qlik.com/t5/QlikView/Join-Question-Eliminate-Duplicate-Values-in-Sum/m-p/446081#M166410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Got it, nevermind.&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt;"&gt;=&lt;SPAN style="color: #0000ff;"&gt;sum&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;Aggr&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Number&lt;/SPAN&gt;,Index)) &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2012 19:51:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-Question-Eliminate-Duplicate-Values-in-Sum/m-p/446081#M166410</guid>
      <dc:creator />
      <dc:date>2012-10-23T19:51:31Z</dc:date>
    </item>
    <item>
      <title>Re: Join Question - Eliminate Duplicate Values in Sum</title>
      <link>https://community.qlik.com/t5/QlikView/Join-Question-Eliminate-Duplicate-Values-in-Sum/m-p/446082#M166411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well the aggr does work.....but running into the same issue I have had using it in the past, it is so darn slow.&amp;nbsp; Would work great on thousands of rows, but I am working with tens of millions of rows so it just doesn't perform fast enough on the front end.&amp;nbsp;&amp;nbsp; I suppose I could load it in the script, but there are a lot of numbers that are impacted so many columns would need to have the aggr run against them, not very elegant.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the suggestions though, probably back to the drawing board on the schema.&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2012 21:39:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-Question-Eliminate-Duplicate-Values-in-Sum/m-p/446082#M166411</guid>
      <dc:creator />
      <dc:date>2012-10-23T21:39:17Z</dc:date>
    </item>
    <item>
      <title>Re: Join Question - Eliminate Duplicate Values in Sum</title>
      <link>https://community.qlik.com/t5/QlikView/Join-Question-Eliminate-Duplicate-Values-in-Sum/m-p/446083#M166412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What are these index issues you were running into (in other words: what is the join really needed for)? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2012 21:46:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-Question-Eliminate-Duplicate-Values-in-Sum/m-p/446083#M166412</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-10-23T21:46:24Z</dc:date>
    </item>
    <item>
      <title>Re: Join Question - Eliminate Duplicate Values in Sum</title>
      <link>https://community.qlik.com/t5/QlikView/Join-Question-Eliminate-Duplicate-Values-in-Sum/m-p/446084#M166413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is the structure, the index with the same name as the table is the primary key (SQL) in each table, the rest foreign keys.&amp;nbsp; (hope you aren't sorry you asked!&amp;nbsp; &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Table1Index&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Table6Index&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Table7Index&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Table2Index&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Table1Index&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Table5Index&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Table3Index&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Table6Index&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Table7Index&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Table4Index&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Table3Index&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Table5Index&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table5&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Table5Index&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Table6Index&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table6&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Table6Index&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Table7Index&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table7&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Table7Index&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tables 1-5 are data tables, 6 and 7 are fact tables.&amp;nbsp;&amp;nbsp; I was attempting to join table 1 to 2 and table 3 to 4 to get around an issue I was having with the key table getting too big and never completing the load.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2012 22:05:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-Question-Eliminate-Duplicate-Values-in-Sum/m-p/446084#M166413</guid>
      <dc:creator />
      <dc:date>2012-10-23T22:05:57Z</dc:date>
    </item>
  </channel>
</rss>

