Skip to Content
0
Jan 29, 2020 at 08:54 PM

Crystal Crosstab Averaging

27 Views

I can get a single page of a crosstab to calculate an average column with the formula by Abhilash Kumar. The problem is the formula only works on the page I applied it to. I have a monthly break in the crosstab and many pages.

Is there a way to get the average formula to work across all pages of a crosstab without putting the formulas into each page of the crosstab in preview mode?

Here is the working crosstab formula from the Abhilash:

local numbervar i;
local numbervar avg;
local numbervar cnt;
//I had to use this variable since currentrowindex was acting funny for some reason

for i := 1 to CurrentColumnIndex-1
do
(avg := avg + GridValueAt(CurrentRowIndex, i, CurrentSummaryIndex);
cnt := cnt + 1; );

(avg+GridValueAt(CurrentRowIndex, 0, CurrentSummaryIndex))/(cnt+1);

Thanks, Dan