Qlik Community

Ask a Question

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Announcements
Welcome to our newly redesigned Qlik Community! Read our blog to learn about all the new updates: READ BLOG and REPORTED ISSUES
cancel
Showing results for 
Search instead for 
Did you mean: 
Contributor III
Contributor III

Aggr not returning the count of customers of two months

I am trying to add the customers who purchased in two months

Customers who purchased in january + customers who purchased in february

 

aggr ( Count ( distinct CUSTOMER_ID), (MONTH={'Jan','Feb'}))

 

my ultimate goal is to create an average of customers between those 2 months

 

(Customers who purchased in january + customers who purchased in february )/ 2

 

but the aggr expression returns a different value than my independent calculations 

 

 

 

(Count({<Month={'Jan'}>} distinct CUSTOMER_ID)) + (Count({<Month={'Feb'}>} distinct CUSTOMER_ID)) works but my aggr formula doesnt

 

Labels (3)
1 Solution

Accepted Solutions

Is your Month field called Month or MONTH? If it is Month, then try this

Sum(Aggr(
    Count(DISTINCT {<Month = {'Jan', 'Feb'}>} CUSTOMER_ID)
, Month))

View solution in original post

4 Replies

May be this

Sum(Aggr(
    Count(DISTINCT {<MONTH = {'Jan', 'Feb'}>} CUSTOMER_ID)
, MONTH))
Contributor III
Contributor III

The result of that formula is zero 😞

Is your Month field called Month or MONTH? If it is Month, then try this

Sum(Aggr(
    Count(DISTINCT {<Month = {'Jan', 'Feb'}>} CUSTOMER_ID)
, Month))

View solution in original post

Contributor III
Contributor III

WOW that one worked, thank you!!!!