Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conditional Subtotal on Top N

Status
Not open for further replies.

bigodwg

Programmer
Apr 19, 2005
9
US
I have a Top N report that has 4 groups: Region, Team, Team Member, and Client.

The 4th group footer ranks the Clients in descending order based on the count of records for the client from the detail.

I need to have seperate totals for each of the other footer sections; one with the sums of the topN and the other with sums for all.

I have divided the footers into A & B sections. The totals are fine, but I am unable to figure out how to create subtotals for the topn section.

For the B section I used Summary fields. For the A section I have tried using running totals but can't figure out to summarize only the records in the TopN.

Crystal Reports XI rel 2


 
The running totals should be set up to do a count of client records, evaluate for each record, reset on change of group: TeamMember. Place this in the TeamMember group footer. It will only count the records for the topN client groups that are displayed. Create separate running totals for each group level, just changing the reset field.

-LB
 
Thank you for the response. That is what I have tried. The running totals are still summarizing all of the data - not just the top N.

I should have included more detail.

The detail section contain the client info that includes 4 categories. Each record has either a 1 or 0 for each of the categories.

Group footer 4 has the sums for each of these categories as part of the line for each client. These summaries are fine.

Group Footer 3a needs to have only the summed totals for each category for the clients that appear on the topn. The running total is as you suggested but still includes all values.

Group Footer 3b has the summed totals for all and is just a summary.

 
When you implemented the topN did you actually use the topN group sort? Or did you use a different method and suppress other group instances?

-LB
 
The report should look like this :

GH1 Region Name
GH2 Team
GH3 Team Member name
Customer Name Catagory1 Catagory2 Catagory3 Totals
GH4 Customer (Not Displayed)
Detail (Not Displayed)
GF4 Customer1 8 2 2 12
GF4 Customer2 7 1 1 9
GF4 Customer3 6 1 1 8

GF3a Top N totals 21 4 4 29
Top N % 72% 13% 13%

GF3b Totals for Bill 33 8 8 49
Total % 67% 16% 16%

GF2a Top N totals 21 4 4 29
Top N % 72% 13% 13%

GF2b Totals for team 33 8 8 49
Total % 67% 16% 16%
GF1a Top N totals 21 4 4 29
Top N % 72% 13% 13%

GF1b Totals for region 33 8 8 49
Total % 67% 16% 16%


 
The running totals should work. Please explain exactly how you set them up.

-LB
 
First - thank you for even taking the time to respond.

An example of hoe I created the running total for group 3a Category 1:

Field to Summarize: report field Category 1
Type of Summary : Sum
Evaluate : For Each Record
Reset : On Change of group - Group 3

I even attempted to create manual running totals with resets and with the WhilePrintingRecords statement at the beginning.
 
And you are saying in your previous example that the running total is returning 33 for Category 1, just like the summary?

Can you verify that you are using no section suppression?

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top