Hello @bobbyfajardo,
I might have a solution for you but it depends on the version you are using. In SAS VA8.3 a new operator was published. AggregateCells aggregates the values of a specific set of cells in the detail data table for an object and allows offset starting point for the aggregation. I have used that operator to basically calculate:
( AggregateCells(_Sum_, 'Bottles_Used'n, column, CellIndex(current, 0), CellIndex(current, 0)) - AggregateCells(_Sum_,'Bottles_Used'n, column, CellIndex(current, -1), CellIndex(current, -1)) ) / AggregateCells(_Sum_, 'Bottles_Used'n, column,CellIndex(current, -1), CellIndex(current, -1))
If you are running < VA8.3 then unfortunately I do not have an answer for you.
Best regards,
Petri
... View more