04-20-2017 10:29 AM
Hi, I would like to multiply the entries in a column similar to the product function in excel. That is, I have the number of claims for there respective fiscal year and would like to mutliply the changes between the fiscal years as in the column Change below. Each year I add new information to the dataset so that the number of fiscal years will change. Any suggestion on how I can do this....thanks
04-20-2017 11:02 AM
I don't see any "product" involved. That looks like last claim/ first claim.
Is there supposed to be grouping variable involved such as a company name?
proc sort data=have; by company fiscalyear; run; data want; set have; by company; retain firstclaim ; if first.company then firstclaim=claim; if last.company then do; cum_variance = claim/firstclaim; output; end; run;
You should know by now how to post data as a datastep and to use the code boxes for posting code.