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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
dana
Creator III
Creator III

Returning Customers - dynamic

Hi People,

I have a request to display returning customers as a dynamic KPI, meaning, for  the previous 6 month of a selected date. 

The user selects a product, and a returning customer would be a customer that bought one or more product after the first buying  date of the selected product. I'm struggling with a Set Analysis expression to  count the relevant  customers. 

I have managed to calculate the number of return dates:

Sum(aggr(Count({<Creation_Date = p({<Product_Group=, Creation_Date = {">$(=min(Creation_Date))"}>} )>}DISTINCT Creation_Date),Customer))

In order to count the relevant customers I added:

=Count({< Customer = {"Sum(aggr(Count({<Product_Group=, Creation_Date = p({<Creation_Date = {'>$(=min(Creation_Date))'}>})>}DISTINCT Creation_Date),Customer))>0"}>}DISTINCT Customer)

But the above doesn't work: the result is 0.

Can someone help me figure out why?

Attached are the model & data.

Thanks in advance!

 

 

 

 

Labels (1)
7 Replies
Anil_Babu_Samineni

Can you share us the demonstrate QVW as well using attached source.

Sum({<DateField={">=$(AddMonths(Max(DateField), -6))<=$(=Max(DateField))"}>} Measure) // This will return last 6 months data

And then, Please explain what is the outcome you are expecting

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
dana
Creator III
Creator III
Author

Hi Anil,

Here is an example:

When the user selected "Bottles", the customers that have bought any products  after the first Bottles buying date are returning.  I attached the model.

Returning Customer.png

Thanks!

Brett_Bleess
Former Employee
Former Employee

@Anil_Babu_Samineni Hey man, here is another post, sorry, it appears notifications are still not working correctly, if you have a minute and can check the follow-up post, much appreciated sir.  Thanks as always!

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.
Anil_Babu_Samineni

Hi, Can you please tell us the outcome here after Bottles selection? and explain the logic behing for output?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
dana
Creator III
Creator III
Author

Hi,

I have rephrased the issue in a different thread and it was resolved:

https://community.qlik.com/t5/QlikView-Creating-Analytics/Set-Analysis-with-nested-AGGR/td-p/1754779

Thanks for your help!

 

dana
Creator III
Creator III
Author

I have rephrased the issue in a different thread and it was resolved:

https://community.qlik.com/t5/QlikView-Creating-Analytics/Set-Analysis-with-nested-AGGR/td-p/1754779

Anil_Babu_Samineni

Glad to hear, Anyway you can mark your reply as answer to close this thread !

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful