Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
samuel_lin
Creator
Creator

Count #Orders for specific products, Determine segmentation by order timing

Hello Qlik Geeks,

I have a data set like this:

     

CustomerIDOrder DateProduct
12310/1/16A
12310/1/16B
12310/3/16C
12310/5/16D
12310/10/16A
45610/1/16A
45610/2/16A
45610/3/16B
45610/5/16C
45610/5/16D
45610/10/16C
45610/11/16C

I want to do something either in the backend script load or front end to:

(1) Segment customers by the number of times placing orders for specific or a group of product; or count the number of times a customer has ordered a specific product

(2) Determine the last date that a certain customer has ordered product A (or any other product)

(3) Segment customers into three segments:

     (a)customers who have recently (within the last 6months) bought productA

     (b)customers who have placed at least an order of productA 6+months ago and continue to buy other products other than A recently (within 6months)

     (c)customers who have placed at least an order of productA 6+months ago and stop buying.

I have tried to create segmentation from load script but the outcome doesn't seem accurate, please help and let me know your thoughts!

Thank you,

Samuel

11 Replies
samuel_lin
Creator
Creator
Author

You're right. I used to apply if on products and order date using "and" and "or"...but the result from the segment isn't correct. I will do more research to see if I can get this solved.

Please let me know if you have any further hint.

Thank you!

samuel_lin
Creator
Creator
Author

Hi Sunny, I am working on the third requirement applying your dimension code:

Aggr(

  If(Today() - Max({<[Product] = {'A', 'B'}>} [order date]) <= 185, Dual('Resent', 1),

  If(Today() - Max({<[Product] = {'A', 'B'}>} [order date]) > 185 and (today() - MAX([order date]))<=185, Dual('Ordered and Continued w/out A&B', 2),

  If(Today() - Max({<[Product] = {'A', 'B'}>} [order date]) > 185 and (today() - MAX([order date])) >185, Dual('Ordered and Lapsed', 3))))

, CustomerID)

The dimension is valid but for some reason, the second segment ("ordered and continued w/out A&B) seems wrong and not showing up. I would love your feedback please.

Thank you so much for your help!

Samuel