Hello. I am working with customer data that looks like this: Order_id Customer_Id order_date Product_id Quantity 1 c1 1/23/2014 P1 10 2 c1 1/23/2016 P1 4 3 c2 2/5/2015 P2 6 4 c2 6/6/2015 P2 2 I would like to find customers whose quantity is decreasing over time based on product_ID and Customer_ID. My final table would like this: Customer Product_ID N order N-1 Order Difference C1 P1 10 4 6 C2 P2 6 2 4 My original idea is to use Proc SQL but I am having trouble figuring out how to the combine the rows based on customer and procuct id. Can anyone provide some help?
... View more