Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
itatspectrum
Partner - Contributor II
Partner - Contributor II

Categorise Clients based on Continuous Monthly Sales

I'm trying to classify my customer sales.

I want to be able to add a category field to my clients.

A - Order value greater 0 in each of the last 3 months.

B - Order value greater 0 in each of the last 6 months.

C - Order value greater 0 in each of the last 9 months.

Not sure what function to use. I'd prefer to use an expression within my chart if possible rather than as part of my load script but I'm open to either.


Any suggestions?


Regards,


Steve

1 Reply
Gysbert_Wassenaar

Perhaps something like this:

If( Count({<Date={">=$(=MonthStart(Max(Date),-2))<=$(=Max(Date))"}, [Order value]={'>0'}>}Distinct Month)=3, A,

If( Count({<Date={">=$(=MonthStart(Max(Date),-5))<=$(=Max(Date))"}, [Order value]={'>0'}>}Distinct Month)=3, B,

If( Count({<Date={">=$(=MonthStart(Max(Date),-8))<=$(=Max(Date))"}, [Order value]={'>0'}>}Distinct Month)=3, C))


I don't know if you have a Date field in your data model. It would help. Month names don't subtract all that well.


talk is cheap, supply exceeds demand