<?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 Getting to grips with aggr() in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Getting-to-grips-with-aggr/m-p/405414#M1150976</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;I'm fairly new to QlikView and I'm trying to get to grips with using the Aggr() function to do some calculations with my data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've ran in to a problem that I'll try to describe with a simple example...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My data model tracks installs of an app and subsequent spends, with 3 dimensions&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;install_date&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;date &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;days_after_install (=date - install_date)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I then have totals of installs and revenue for each date for cohorts of users, defined by their install_date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By definition installs happened on day_after_install=0 and so are 0 for all other days.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to aggregate to find the total number of installs that have "had their day 2" for instance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've attached an example of what I'm trying to acheive, there are 62 installs all occuring on a day 0 for a given install_date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I start by using&amp;nbsp; &lt;STRONG&gt;aggr(NODISTINCT sum(installs), dt), &lt;/STRONG&gt;this gives the number of installs for an install date on each row (e.g. cohort size)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I have tried to use &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;aggr(sum(DISTINCT aggr(NODISTINCT sum(installs), dt)), days_after_install)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to aggregate these cohort sizes by days_after_install. I'm expecting this to give me the sum of cohort sizes having had day x.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but, for instance, the total size on day 0 is 44 (not 62 as in the basic sum)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope the example is clear, any help on this is appreciated!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 26 Apr 2013 15:44:38 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-04-26T15:44:38Z</dc:date>
    <item>
      <title>Getting to grips with aggr()</title>
      <link>https://community.qlik.com/t5/QlikView/Getting-to-grips-with-aggr/m-p/405414#M1150976</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;I'm fairly new to QlikView and I'm trying to get to grips with using the Aggr() function to do some calculations with my data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've ran in to a problem that I'll try to describe with a simple example...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My data model tracks installs of an app and subsequent spends, with 3 dimensions&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;install_date&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;date &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;days_after_install (=date - install_date)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I then have totals of installs and revenue for each date for cohorts of users, defined by their install_date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By definition installs happened on day_after_install=0 and so are 0 for all other days.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to aggregate to find the total number of installs that have "had their day 2" for instance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've attached an example of what I'm trying to acheive, there are 62 installs all occuring on a day 0 for a given install_date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I start by using&amp;nbsp; &lt;STRONG&gt;aggr(NODISTINCT sum(installs), dt), &lt;/STRONG&gt;this gives the number of installs for an install date on each row (e.g. cohort size)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I have tried to use &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;aggr(sum(DISTINCT aggr(NODISTINCT sum(installs), dt)), days_after_install)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to aggregate these cohort sizes by days_after_install. I'm expecting this to give me the sum of cohort sizes having had day x.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but, for instance, the total size on day 0 is 44 (not 62 as in the basic sum)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope the example is clear, any help on this is appreciated!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Apr 2013 15:44:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Getting-to-grips-with-aggr/m-p/405414#M1150976</guid>
      <dc:creator />
      <dc:date>2013-04-26T15:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: Getting to grips with aggr()</title>
      <link>https://community.qlik.com/t5/QlikView/Getting-to-grips-with-aggr/m-p/405415#M1150977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi to Learn more about aggr Function check this out..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="loading"&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/blogs/qlikviewdesignblog/2013/03/07/aggr"&gt;http://community.qlik.com/blogs/qlikviewdesignblog/2013/03/07/aggr&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Apr 2013 15:26:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Getting-to-grips-with-aggr/m-p/405415#M1150977</guid>
      <dc:creator>shree909</dc:creator>
      <dc:date>2013-04-29T15:26:02Z</dc:date>
    </item>
  </channel>
</rss>

