Crystal Report - Cross Tab - with percentage

Good afternoon,

I have a cross tab report that summarizes Credits and Invoices - I need a percentage at the bottom to show the percent of credits vs invoice for the categories.

I'm not all that savvy with Cross Tab reports - so I need some help on getting the Percentage to show.  Can you help?


Attached example of Cross tab and report with Data
Erin LealeConsultant/ControllerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I don't believe you can get that to work with a cross tab.

You should be able to put the value field in twice and show one as a % but then you will see the credits also.

Erin LealeConsultant/ControllerAuthor Commented:
Thanks.  Do you think it is possible to create a line underneath the cross tab with that information?  Every formula I try returns 0.  Not sure what I'm doing wrong.
If you can group the report by Customer Type, then I think that you can actually add those %'s to the cross-tab.  Basically, you create formulas that you can use to get a count of the invoices and credits for each Customer Type group, then another formula that divides the credit count by the invoices, and divides that result by a count of the records in the Customer Type group.  When you add that last formula to the cross-tab, it adds the figures together and the total for each Customer Type is the %.  For example, if you had 2 credits and 10 invoices, that's .2, and .2 / 12 = .01666.  Then the cross-tab would add the .01666 for each record, and you get .2 as the total.

 One basic downside to that approach is that you have to add that formula as another field in the cross-tab, but you're presumably only interested in the grand totals and don't want to see the totals for invoices and credits.  You can minimize the impact by suppressing the invoice/credit total fields and making them as small as possible, so that they aren't visible and don't add too much space to the cross-tab.  The %'s at the bottom also won't have a label explaining what they are.  They'll just be at the bottom with the other column totals.

 The "trick" to that approach is that the report has be grouped by Customer Type, so that you can use that group in the formulas to get the counts for each type.

 If you don't want to group that report by Customer Type, you could use a subreport instead (placed in a separate section under the current cross-tab).  The subreport would read the same basic data (whatever was required to get the invoice and credit counts), but be grouped by the Customer Type, and it could use the method described above to produce a cross-tab with the %'s.

 FWIW, I'm attaching a copy of your report, grouped by Customer Type and with the %'s added to the cross-tab using the method I described earlier.  @Count_CR and @Count_Inv are used to get the credit and invoice counts for each Customer Type, and @CR_Inv_percent calculates the CR/Inv % and divides that by the record count for each Customer Type, and the cross-tab summarizes that.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Erin LealeConsultant/ControllerAuthor Commented:
This worked.  I thought I had responded but I must not have saved the response.  Thanks James0628!
You're welcome.  Glad I could help.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.