<?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 Easy aggr and/or Distinct Sum question in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Easy-aggr-and-or-Distinct-Sum-question/m-p/378636#M494928</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Another easy one for a newbie, all I need to do is sum up each distinct value in the column 'VALUE' for every distinct value in 'INDEX'.&amp;nbsp; What formula will do this?&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="20308" class="jive-image" alt="table.PNG" src="https://community.qlik.com/legacyfs/online/20308_table.PNG" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Resulting table in QV should be:&lt;/P&gt;&lt;P&gt;Index&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Value&lt;/P&gt;&lt;P&gt;1&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; 1&lt;/P&gt;&lt;P&gt;2&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; 0&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;3&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; 1&lt;/P&gt;&lt;P&gt;6&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; 1&lt;/P&gt;&lt;P&gt;7&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; 1&lt;/P&gt;&lt;P&gt;8&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; 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks very much!&amp;nbsp;&amp;nbsp; I assume the answer will involve SUM, DISTINCT and AGGR somehow.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Aug 2012 16:10:00 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-08-16T16:10:00Z</dc:date>
    <item>
      <title>Easy aggr and/or Distinct Sum question</title>
      <link>https://community.qlik.com/t5/QlikView/Easy-aggr-and-or-Distinct-Sum-question/m-p/378636#M494928</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Another easy one for a newbie, all I need to do is sum up each distinct value in the column 'VALUE' for every distinct value in 'INDEX'.&amp;nbsp; What formula will do this?&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="20308" class="jive-image" alt="table.PNG" src="https://community.qlik.com/legacyfs/online/20308_table.PNG" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Resulting table in QV should be:&lt;/P&gt;&lt;P&gt;Index&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Value&lt;/P&gt;&lt;P&gt;1&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; 1&lt;/P&gt;&lt;P&gt;2&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; 0&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;3&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; 1&lt;/P&gt;&lt;P&gt;6&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; 1&lt;/P&gt;&lt;P&gt;7&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; 1&lt;/P&gt;&lt;P&gt;8&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; 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks very much!&amp;nbsp;&amp;nbsp; I assume the answer will involve SUM, DISTINCT and AGGR somehow.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2012 16:10:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Easy-aggr-and-or-Distinct-Sum-question/m-p/378636#M494928</guid>
      <dc:creator />
      <dc:date>2012-08-16T16:10:00Z</dc:date>
    </item>
    <item>
      <title>Re: Easy aggr and/or Distinct Sum question</title>
      <link>https://community.qlik.com/t5/QlikView/Easy-aggr-and-or-Distinct-Sum-question/m-p/378637#M494929</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;&lt;EM&gt;=sum( aggr( Value, Index, Value))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The distinct part should be implicitely defined for the aggr() function.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2012 16:13:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Easy-aggr-and-or-Distinct-Sum-question/m-p/378637#M494929</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-08-16T16:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: Easy aggr and/or Distinct Sum question</title>
      <link>https://community.qlik.com/t5/QlikView/Easy-aggr-and-or-Distinct-Sum-question/m-p/378638#M494930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks this definitely works!&amp;nbsp;&amp;nbsp; Although I am not sure why.&amp;nbsp; Could you very briefly explain how it is operating on the data?&amp;nbsp; Thanks again for such a quick answer!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2012 17:24:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Easy-aggr-and-or-Distinct-Sum-question/m-p/378638#M494930</guid>
      <dc:creator />
      <dc:date>2012-08-16T17:24:00Z</dc:date>
    </item>
    <item>
      <title>Re: Easy aggr and/or Distinct Sum question</title>
      <link>https://community.qlik.com/t5/QlikView/Easy-aggr-and-or-Distinct-Sum-question/m-p/378639#M494931</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The aggr() function will build like a local or temporary table, with the first argument (Value) being the table expression, all other arguments (Index, Value) the table dimensions. You should be able to create e.g. a straight table with dimensions Index and Value and expression =Value to get an idea of how this looks like. This temporary table returns a vector or array of expression results (or in other words, a column), one result per combination of dimension values. This array can then be aggregated again (here by using sum()).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2012 21:57:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Easy-aggr-and-or-Distinct-Sum-question/m-p/378639#M494931</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-08-16T21:57:07Z</dc:date>
    </item>
    <item>
      <title>Re: Easy aggr and/or Distinct Sum question</title>
      <link>https://community.qlik.com/t5/QlikView/Easy-aggr-and-or-Distinct-Sum-question/m-p/378640#M494932</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks again for the information.&amp;nbsp; The expression works fine, unless i have greater than 1 million rows of data.&amp;nbsp;&amp;nbsp; It is painfully slow.&amp;nbsp; I have tried to speed it up in various ways but nothing has been successful.&amp;nbsp;&amp;nbsp; Are there any other options that might run faster?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Aug 2012 15:14:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Easy-aggr-and-or-Distinct-Sum-question/m-p/378640#M494932</guid>
      <dc:creator />
      <dc:date>2012-08-20T15:14:17Z</dc:date>
    </item>
    <item>
      <title>Re: Easy aggr and/or Distinct Sum question</title>
      <link>https://community.qlik.com/t5/QlikView/Easy-aggr-and-or-Distinct-Sum-question/m-p/378641#M494933</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe you could prepare everything in the script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD DISTINCT&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Index, Value as Value2Sum&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;resident YourTable;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then do a sum(Value2Sum) in your table chart with dimension Index (which is the key to YourTable, so it should be sensitive to selections affecting Index). &lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Aug 2012 22:14:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Easy-aggr-and-or-Distinct-Sum-question/m-p/378641#M494933</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-08-20T22:14:54Z</dc:date>
    </item>
    <item>
      <title>Re: Easy aggr and/or Distinct Sum question</title>
      <link>https://community.qlik.com/t5/QlikView/Easy-aggr-and-or-Distinct-Sum-question/m-p/378642#M494934</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, I am loading in 2 tables:&lt;/P&gt;&lt;P&gt;Example of first (every index value is unique, which is what i sum up):&lt;/P&gt;&lt;P&gt;Index&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Value&lt;/P&gt;&lt;P&gt;1&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; 2&lt;/P&gt;&lt;P&gt;2&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; 5&lt;/P&gt;&lt;P&gt;3&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; 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then i left join to table #2 on Index:&lt;/P&gt;&lt;P&gt;Index&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Data1&lt;/P&gt;&lt;P&gt;1&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; a&lt;/P&gt;&lt;P&gt;1&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; b&lt;/P&gt;&lt;P&gt;2&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; a&lt;/P&gt;&lt;P&gt;3&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; c&lt;/P&gt;&lt;P&gt;3&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; e&lt;/P&gt;&lt;P&gt;etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the resulting QV table ends up with the&amp;nbsp; 'Value' being duplicated due to the left join of table 2.&lt;/P&gt;&lt;P&gt;I hope this is easy to understand and makes sense.&lt;/P&gt;&lt;P&gt;I removed the join, but then overall performance in the app was bad due to 2 huge tables (millions of records each) instead of 1 huge table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So not sure if i can load distinct sense I need all these values.&amp;nbsp; Or can I?&amp;nbsp; &lt;/P&gt;&lt;P&gt;I really really appreciate your helping me out with this!&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Aug 2012 15:04:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Easy-aggr-and-or-Distinct-Sum-question/m-p/378642#M494934</guid>
      <dc:creator />
      <dc:date>2012-08-21T15:04:38Z</dc:date>
    </item>
    <item>
      <title>Re: Easy aggr and/or Distinct Sum question</title>
      <link>https://community.qlik.com/t5/QlikView/Easy-aggr-and-or-Distinct-Sum-question/m-p/378643#M494935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I assumed that you are JOIN tables here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you have millions of Index values? Well, I am not really sure what you want to achieve in the big picture, but if you want to keep the joined tables for performance (was this a big performance gain?), I would go for that, so left join your tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if you want to speed up the sum up of values per index, I think the first table would be ideal for this, so why not keep this table (as I said, only the Index and Value renamed, so you have only Index ans key between tables).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would assume that should not increase your memory consumption too much, but should really speed up your sum. (and QV only uses this table if you address the Value2Sum field, if you ask for the Value for any given Col1 / Col2, QV should use the left joined Value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this makes sense, but probably I just don't fully understand your complete requirements and setting.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Aug 2012 18:08:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Easy-aggr-and-or-Distinct-Sum-question/m-p/378643#M494935</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-08-21T18:08:49Z</dc:date>
    </item>
  </channel>
</rss>

