[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 271
  • Last Modified:

Crystal Reports 10 - how to summarize data across groups and make available to all groups

I have a reports with the following group structure:

Chain - Group 1
Rep - Group 2
Due Date - Group 3

A rep can belong to more than one chain.  I need to know how many chains the rep belonged to at a particular due date to and then make that total it available to a formula in the due date group.

For example, Rep A services Chain 1, Chain 2 and Chain 3 on due date 7/1.  I need to get the value 3 into a formula in the due date group so I can divide a total amount by that number to share costs across all chains the rep serviced in that due date.
0
kristenhazard
Asked:
kristenhazard
  • 2
  • 2
1 Solution
 
mlmccCommented:
I am nt sure if it can be done easily.  How many Reps?

It might make more sense for this report to group it differently.

mlmcc
0
 
bdreed35Commented:
You could do this using a subreport and a shared variable.

Your subreport would need to get the total amount by rep.
When you add it to the main report, link on rep id (perhaps other fields as well), and then place the subreport in the Group 2 (Rep) Header.  It would be a good idea to create a second Group Header 2 section and place the subreport in section b.
Your subreport is there just to perform a calculation and to provide that value back to the main report.

The next step would be to create several formulas.

1. @Init - Place it in Group Header 2b - Main Report
shared numbervar rep_amount := 0;

2. @Set - Place it in Subreport Report Footer.
shared numbervar rep_amount := count({table.chainid}); //you may be counting a different field here

Now, you can reference the shared variable in your own calculations in the main report to determin that share costs.
0
 
kristenhazardAuthor Commented:
Thanks bdreed35, I'll give that a try.
0
 
bdreed35Commented:
I believe I offered a suitable solution, but the poster never responded back.
0
 
kristenhazardAuthor Commented:
OK, I was not finishing the accept process in the second page. I have now accepted bdreed35.  Sorry for the mix up.
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

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