<?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 Advanced aggregation in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Advanced-aggregation/m-p/162767#M36156</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, works perfectly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Nov 2009 17:41:56 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-11-25T17:41:56Z</dc:date>
    <item>
      <title>Advanced aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Advanced-aggregation/m-p/162763#M36152</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;BR /&gt;We have a bunch of daily profit and loss numbers with each days data being tagged with 4 product levels, e.g.&lt;/P&gt;&lt;P&gt;Date = 1st Jan 2009&lt;/P&gt;&lt;P&gt;L0 = A&lt;/P&gt;&lt;P&gt;L1 = B&lt;/P&gt;&lt;P&gt;L2 = C&lt;/P&gt;&lt;P&gt;L3 = D&lt;/P&gt;&lt;P&gt;P&amp;amp;L = 100&lt;/P&gt;&lt;P&gt;We want to be able to generate a table which, for each product shows how many days had a negative P&amp;amp;L. This is fine when we hardcode the product level, however we want to be able to drill up/down through the product levels (L0-&amp;gt;L3) and aggregate the number of days with a negative P&amp;amp;L. This is I suppose the equivalent of doing an expression like:&lt;/P&gt;&lt;P&gt;count(distinct if(sum(P&amp;amp;L)&amp;lt;0, Date))&lt;/P&gt;&lt;P&gt;Clearly though this won't work as you can't nest aggregation functions in this way.&lt;/P&gt;&lt;P&gt;Is there another way of doing this?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Nov 2009 01:26:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Advanced-aggregation/m-p/162763#M36152</guid>
      <dc:creator />
      <dc:date>2009-11-24T01:26:14Z</dc:date>
    </item>
    <item>
      <title>Advanced aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Advanced-aggregation/m-p/162764#M36153</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You should be able to use Aggr() between the aggregation functions to aggregate the first sum over the dimension value.&lt;/P&gt;&lt;P&gt;count(distinct aggr(if(sum(P&amp;amp;L)&amp;lt;0, Date), Dimension))&lt;/P&gt;&lt;P&gt;If your dimension is a group consisting of dimensions L0-L3 you should be able to use getcurrentfield( myGroup ) to return the currently active dimension to the expression like:&lt;/P&gt;&lt;P&gt;count(distinct aggr(if(sum(P&amp;amp;L)&amp;lt;0, Date), getcurrentfield(myGroup)))&lt;/P&gt;&lt;P&gt;This as always depends on what your actual document looks like.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Nov 2009 10:46:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Advanced-aggregation/m-p/162764#M36153</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-11-24T10:46:11Z</dc:date>
    </item>
    <item>
      <title>Advanced aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Advanced-aggregation/m-p/162765#M36154</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Johannes, thanks for the quick reply.&lt;/P&gt;&lt;P&gt;I could get it to work though as it wouldn't let me use the group dimension in the expression. Have mocked up a quick example of what I am trying to do and attached it. All assistance greatly appreciated!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2009 00:55:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Advanced-aggregation/m-p/162765#M36154</guid>
      <dc:creator />
      <dc:date>2009-11-25T00:55:39Z</dc:date>
    </item>
    <item>
      <title>Advanced aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Advanced-aggregation/m-p/162766#M36155</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Take a look at this one, only slight correction from Johannes suggestion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2009 02:45:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Advanced-aggregation/m-p/162766#M36155</guid>
      <dc:creator />
      <dc:date>2009-11-25T02:45:12Z</dc:date>
    </item>
    <item>
      <title>Advanced aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Advanced-aggregation/m-p/162767#M36156</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, works perfectly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2009 17:41:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Advanced-aggregation/m-p/162767#M36156</guid>
      <dc:creator />
      <dc:date>2009-11-25T17:41:56Z</dc:date>
    </item>
  </channel>
</rss>

