cancel
Showing results for 
Search instead for 
Did you mean: 

Formula assistance in crystal reports

Former Member
0 Kudos

Hello,

I have a report that has 2 groups, first is by category and second is by code and the report displays Quantity which is sum in group footer 1 and 2

I want to create a column ' %', how do I pull in the sum of quantity in group footer 1 in the formula to calculate % column?

Header 1CODEQUANTITY%
GROUP 1 CATEGORY
GROUP 2 CODE
DETAILS SUPPRESSED
GROUP 2 FOOTER ( note any rows with quantity 0 are suppressed)11116(6/18)*100 = 33.33%
GROUP 2 FOOTER  ( note any rows with quantity 0 are suppressed)2222316.66%
GROUP 2 FOOTER  ( note any rows with quantity 0 are suppressed)333315.55%
GROUP 2 FOOTER  ( note any rows with quantity 0 are suppressed)4444844.44%
GROUP 1 FOOTER18

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Swati,

Go to Insert > Summary > Choose the Qty field > Choose the right summary operation > Select the Summary Location as 'Group #2' > Under 'options' choose 'Show as Percentage of' > Choose 'Group

#1:'.

-Abhilash

Answers (2)

Answers (2)

Former Member
0 Kudos

Thank you both methods worked.. lately using crystal as just a display tool doing all the legwork in command..now getting back to crystal could not think of these two methods.

abhilash_kumar
Active Contributor
0 Kudos

Glad we could help. Please close the thread.

-Abhilash

DellSC
Active Contributor
0 Kudos

Try using a formula like this:

if Sum({quantity field}, {category group field}) > 0  then //prevent divide by 0 error

  Sum({quantity field}, {code group field}) % Sum({quantity field}, {category group field})

else 0

Note that the "%" operator will automatically do the percent calculation for you.

-Dell