Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Hansa1
Contributor
Contributor

Show all customers who have not ordered anything the past 6 months

Hi, I'm very new to Qlik so please bear with me 🙏

 

I have an expression that returns all customers who have ordered the past 6 months: 

=count({<OrderDate = {">=$(=Date(AddMonths(Max(OrderDate), -6)))<=$(=Date(Max(OrderDate)))"}>} DISTINCT CustomerID)

 

But my goal is to return all customers who have not ordered anything the past 6 months. How can I do this? 

 

Thanks!

Labels (1)
1 Solution

Accepted Solutions
Gabbar
Specialist
Specialist

Exclude these Customers using exclude like:-


count({<

CustomerID=e({<OrderDate = {">=$(=Date(AddMonths(Max(OrderDate), -6)))<=$(=Date(Max(OrderDate)))"}>})

>} DISTINCT CustomerID)

Remeber now there are two set expression here , one of exclude and one complete, so please make sure which filters affect which expressions.

View solution in original post

2 Replies
Gabbar
Specialist
Specialist

Exclude these Customers using exclude like:-


count({<

CustomerID=e({<OrderDate = {">=$(=Date(AddMonths(Max(OrderDate), -6)))<=$(=Date(Max(OrderDate)))"}>})

>} DISTINCT CustomerID)

Remeber now there are two set expression here , one of exclude and one complete, so please make sure which filters affect which expressions.

Hansa1
Contributor
Contributor
Author

Thanks for the help Gabbar!