Looking for best practice to allocate best available promotion to my customers. Sample Data below: data have; input customer $ customer_rank promo_id promo_score; datalines; carl 1 4000 9 carl 1 4001 7 carl 1 4002 4 carl 1 4003 3 jess 2 4000 9 jess 2 4004 7 jess 2 4002 5 jess 2 4001 3 robb 3 4004 8 robb 3 4000 6 robb 3 4002 5 robb 3 4008 2 amii 4 4004 8 amii 4 4000 7 amii 4 4001 4 amii 4 4002 3 ; run; I am looking for code that would assign each customer the best promotion (based on promo_score), BUT I can only assign the promo_id once (two customers cannot receive same promo_id) so in this example I would want carl (as he is my top customer) to get 4000, jess to get 4004 (since 4000 is gone), robb to get 4004 and amii to get 4001 (since her top 2 are gone). Thank you so much!!
... View more