Hi, The count column doesnt even show up when I run the following: proc sort data=agents2 out= agents3 (keep=agent_id &time_var. sale_dt tran_dt &var.); /*specify here what you want it to keep*/ by agent_id sale_dt tkt; run; data test; set agents3; retain count; by agent_id; if first.agent_id and tkt>0 then do; count=0; end; count+1; run; I just get the agent_id, date and tkt (my number of sales variable)
... View more