Print Page | Close Window

Group results in a different group

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=21091
Printed Date: 04 May 2024 at 5:06am


Topic: Group results in a different group
Posted By: peteGE
Subject: Group results in a different group
Date Posted: 02 Oct 2014 at 12:20am
Hello,
 
I`ve got a report where I want to group results by a deal number but also want to sum one field by another group.
 
I have my fields in group footer which is grouped by deal_no.
 
Then I have a field where I`m trying to summarize amount per a column comments in DB using command:
Sum({Command.AMOUNT},{Command.TRIM(REGEXP_REPLACE(B.COMMENTS,'CUM'))})
So I`ve got another group in my report - {Command.TRIM(REGEXP_REPLACE(B.COMMENTS,'CUM'))}.
 
Since I want to have my report sorted by deal_no I`ve got them in group footer grouped by DEAL_NO. However, if I count the sum of the field above it also summarize the results by deal number but I`d like to have it summarized by the command.
 
Is there any way how to do it? Can I summarize a field grouped by command within another group (grouped by deal_no)?
 
Thank you.
 
Best regards,
 
Petr



Replies:
Posted By: DBlank
Date Posted: 02 Oct 2014 at 3:49am
If you want the summary in the group header or footer you can summarize a sub set of records that fall inside that group. It will not include records that are in another group. The only way to do that would be to use a subreport that re-queries the entire data set that is used int he main report.
 
EDIT: If you used a variable formula in the main report it could include records that are printed before the display location but it would not include records after the display location.



Print Page | Close Window