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

Count customers with aggr

I have the following:

'CustomerData': A table of DATES and CUSTOMERS, each register show the date when a customer made a purchase. Fields Date, Customer.

'Date_Star' : A table with all the dates from CustomerData.Date. Only a field called DateStar

'Date_End' : A table with all the dates from CustomerData.Date. Only a field called DateEnd.

The user can select a 'DateStar' an a 'DateEnd'. Obviously DateStar <= DateEnd.

QlikView must select those registers that the Date is between DateStar and DateEnd, and search if for each customer exist other register at least 30 days. QlikView count how many customers match.

Example:

DateStar 04/02/2013 (Feb 04, 2013)

DateEnd           14/02/2013 (Feb 14, 2013)

Then, this registers are between the dates given:

Date                    Customer

04/02/2013          2190038

11/02/2013          2190034

14/02/2013          2190031

And checking the data:

Customer 2190038: previous purshase 06/01/2013. Then 04/02/2013 - 06/01/2013 = 29 days. <-- (Less than 30)

Customer 2190034: previous purshase 30/10/2012. Then 11/02/2013 - 30/10/2012 = 104 days. <-- (Greater than 30)

Customer 2190031: previous purshase 14/01/2013. Then 14/02/2013 - 14/01/2013 = 31 days. <-- (Greater than 30)

QlikView response should be: 2.

I'm using Aggr but don't work.

Thanks.

Labels (1)
1 Solution

Accepted Solutions
swuehl
Champion III
Champion III

Maybe like attached using a script calculated field for the interval and set analysis?

View solution in original post

2 Replies
swuehl
Champion III
Champion III

Maybe like attached using a script calculated field for the interval and set analysis?

Not applicable
Author

Thanks swuehl, the script works perfect !! I can't understant very well how you calculate 'interval', but all it's ok. Thanks again.