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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Qlikuser09
Creator II
Creator II

How to get the customers that are not part of the sales in the last three months? using Year Month

({$<Customer ID=p()*e({<Date={">=$(=AddMonths(Max(Date),-3))<$(=Max(Date))"}, YearMonth=>}), YearMonth=>} This is not working

4 Replies
Kushal_Chawda

@Qlikuser09  if your date is in proper date format then try below

=sum({<YearMonth,Customer_ID=e({<YearMonth,Date={">=$(=addmonths(max(Date),-2))<=$(=max(Date))"}>}Customer_ID)>}Sales)
Qlikuser09
Creator II
Creator II
Author

Thanks for your reply, I want to get the ID's of the customers who are inactive in the last 3 months

Kushal_Chawda

@Qlikuser09  The expression which I have provided will give you what you want

Qlikuser09
Creator II
Creator II
Author

But I am not getting distinct customer's Im getting something similar to this. Where some customer id's are repeated

Customer IDPurchase year month
12021-4
22021-4
22021-4
32021-3
42021-2
42021-2
52021-1
62021-1
72021-1
72018-5
82017-3
92020-7
102020-3
112021-1