cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal Reports 2011 Running total on columns in Cross Tab

Former Member
0 Kudos

Hi All,

I am having a requirement where in we created a cross tab with Months in Rows. years in columns and quantity in details. But when I do the running total for Quantity, it is summing across the rows and I am not able to get the data as below:

Please let me know how I can use the Running total on columns in a cross tab, below is my expected output.

2011
QuantityRunningTotalOfQuantity
Jan100100
Feb200300
Mar300600
Apr4001000
May5001500
Jun6002100
Jul7002800
Aug8003600
Sep9004500
Oct10005500
Nov11006600
Dec12007800

Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Madhavi,

Are you looking to add the 'RunningTotalOfQuantity' as a column beside 'Quantity'?

What version of CR are you using?

-Abhilash

Former Member
0 Kudos

Hi Abhilash,

Yes, I am looking to add the 'RunningTotalOfQuantity' as a column beside 'Quantity'. I am using Crystal Reports 2011 and also have pasted the screen capture of version from CR.

Thanks,

Madhavi

abhilash_kumar
Active Contributor
0 Kudos

Here's what you need to do:

1) While in the Preview Mode, Right-click the header cell for 2011 and select Calculated Member > Insert Column. A blank column with zero values should be inserted after 2011 with a blank header

2) Right-click one of the zero values in the new column and select Calculated Member > Edit Calculation Formula and use this code:

if CurrentRowIndex = 0 then

GridValueAt(CurrentRowIndex, CurrentColumnIndex-1, CurrentSummaryIndex)

else

GridValueAt(CurrentRowIndex, CurrentColumnIndex-1, CurrentSummaryIndex) +

GridValueAt(CurrentRowIndex-1, CurrentColumnIndex, CurrentSummaryIndex)

3) Right-click the blank header cell for this column and select Calculated Member > Edit Header formula. Type in a header for this column, like:

"Running Sum"

That's it. Let me know how this goes.

-Abhilash