• Status: Solved
  • Priority: High
  • Security: Public
  • Views: 56
  • Last Modified:

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?

Thanks!

Attached example of Cross tab and report with Data
Cross-Tab-Example.pdf
AR_CreditRebill_expechange.rpt
0
Erin Leale
Asked:
Erin Leale
  • 2
  • 2
1 Solution
 
mlmccCommented:
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.

mlmcc
0
 
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.
0
 
James0628Commented:
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.

 James
AR_CreditRebill_expechange_J.rpt
0
 
Erin LealeConsultant/ControllerAuthor Commented:
This worked.  I thought I had responded but I must not have saved the response.  Thanks James0628!
0
 
James0628Commented:
You're welcome.  Glad I could help.

 James
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now