Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Getting to grips with aggr()

Hi,

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.

I've ran in to a problem that I'll try to describe with a simple example...

My data model tracks installs of an app and subsequent spends, with 3 dimensions

install_date

date

days_after_install (=date - install_date)

I then have totals of installs and revenue for each date for cohorts of users, defined by their install_date.

By definition installs happened on day_after_install=0 and so are 0 for all other days.

I want to aggregate to find the total number of installs that have "had their day 2" for instance.

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.

I start by using  aggr(NODISTINCT sum(installs), dt), this gives the number of installs for an install date on each row (e.g. cohort size)

Then I have tried to use

aggr(sum(DISTINCT aggr(NODISTINCT sum(installs), dt)), days_after_install)

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.

but, for instance, the total size on day 0 is 44 (not 62 as in the basic sum)

I hope the example is clear, any help on this is appreciated!

Labels (1)
1 Reply
shree909
Partner - Specialist II
Partner - Specialist II

Hi to Learn more about aggr Function check this out..

http://community.qlik.com/blogs/qlikviewdesignblog/2013/03/07/aggr