So you need the previous quarter sales to create a curve for the next quarters months?
But I don't understand what interpollation means here. Aren't the sales figures a sum of sales for each quarter? Wouldn't you then divide each month by three (after creating your curve)...?
Or does month mean rolling 3 months sales? Then it makes sense.
Also, didn't understand how you want to manage brands that doesn't exist certain periods. In you result table you have removed Tesla.
First of all, transpose your data so you have one row per brand, year and quarter (this should always be the default structure when storing data).
Sort by brand, year and quarter.
You can then use RETAIN in a data step to keep the previous quarters sales when looking at the next record.
You can keep track on that you are working with the same brand by using BY statement, and use first. and last. logic to assign and calculating values.
Pseudo code for last step, untested:
data want;
set have;
by brand;
retain prev_qsales;
if not first.brand then do;
do m=1 to 3;
/* your calculation logic goes here */
month = (quarter - 1) * 3 + m;
output;
end;
end;
if not last.brand prev_qsales = sales;
run;
... View more