Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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.