Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Summarize group totals Post Reply Post New Topic
<< Prev Page  of 2
Author Message
stewary
Newbie
Newbie


Joined: 18 Dec 2009
Online Status: Offline
Posts: 13
Quote stewary Replybullet Posted: 21 Dec 2009 at 7:50am
Row level data:
 
ID               Job#     Activated    Revoked
 
121345       19            False         True
121345       34            True          False
121346       35            True          False
121347       36            True          False
121347       42            False         True
 
 
The Activated and Revoked columns are counted if they are true.
The group level is based on the ID field.
 
 
Activated:  3
Revoked:   2
 
--The group level totals are correct (above).  It is just when totals are created without the grouping is when I am getting all records evaluated instead of the grand totals of the group level totals as shown below...
 
Total Activated:  98
Total Revoked:   209
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 21 Dec 2009 at 8:44am

My previous RT was counting each ID only once (per RT) if it had any row that had True in it (the DistinctCount usage).

Based on your description you want to count every instance of TRUE regardless of grouping or overlapping of records. So an ID row may be counted multiple times. If that is the case change the RT from a DistinctCount to a Count. If that does not give you the corect numbers then there is some other criteria that you have that is not explained or I am jsut not seeing / understanding.
(As a reminder Running Totals have to be placed details or Footers in order to give you totals.)
 
Name=TotalActivated
Field to summarize= ID
Type of Summary=Count
Evaluate= Use a Formula...table.activated=True
Reset=Never
 
Name=TotalRevoked
Field to summarize= ID
Type of Summary=Count
Evaluate= Use a Formula...table.revoked=True
Reset=Never


Edited by DBlank - 21 Dec 2009 at 8:45am
IP IP Logged
stewary
Newbie
Newbie


Joined: 18 Dec 2009
Online Status: Offline
Posts: 13
Quote stewary Replybullet Posted: 21 Dec 2009 at 9:25am
The change to "count" did not work either.  And what you have explained is exactly what I want with one caveat.  I need to have the combined totals of the group sub totals as they are shown in the report. 
 
This may not be possible using running totals or any other way.  The group sub totals were created in the group footer that is also suppressed with a condition of the ID field that uses a shared variable.  The group footer is suppressed  if the ID field is an empty string, as ( ID="").  I believe this conditional suppression is allowing for me to see the correct values in the sub totals. 
 
Unfortunately, I cannot do the same for the grand totals that are located in the report footer as this would suppress the entire footer.  The ID field is populated with data from a subreport that must use the shared variable.  I believe that is my issue.
 
If you can think of any work-around or trick that would be wonderful.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 21 Dec 2009 at 9:35am
Name=TotalActivated
Field to summarize= ID
Type of Summary=Count
Evaluate= Use a Formula...table.activated=True and table.id<>""
Reset=Never
 
Name=TotalRevoked
Field to summarize= ID
Type of Summary=Count
Evaluate= Use a Formula...table.revoked=True and table.id<>""
Reset=Never
IP IP Logged
stewary
Newbie
Newbie


Joined: 18 Dec 2009
Online Status: Offline
Posts: 13
Quote stewary Replybullet Posted: 21 Dec 2009 at 3:50pm
That doesn't work either (get error message) because the ID field is built upon a shared variable that can only be define as whileprintingrecords which is the same time the running totals are created.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 22 Dec 2009 at 12:37pm

Sorry I have not given you a solution that works as yet.

Since I do not know the various parts of your report it makes it difficult to assist.
At this point I would disect the formula that gives you the ID value and change the RT formula to exclude the records that end up being an empty string.
so the
table.activated=True and table.id<>""
will become some variation to properly exclude the rows that you want excluded.
IP IP Logged
stewary
Newbie
Newbie


Joined: 18 Dec 2009
Online Status: Offline
Posts: 13
Quote stewary Replybullet Posted: 23 Dec 2009 at 5:30am
Okay, I found the solution via variables.  This is what I did...
 
Formulas #1 and #2 placed in Details Section and suppressed...
Formula #1:
IF {table.activated}=True and table.id<>"" then 1;
 
Formula #2:
whileprintingrecords;
global numbervar activatesum;
activatesum :=activatesum + (name of Formula #1);
 
Formula #3 placed in Report Footer Section...
Formula #3:
whileprintingrecords;
global numbervar activatesum;
 
Thank you for all your help and patience.
Merry Christmas and Happy New Year!
 
IP IP Logged
<< Prev Page  of 2
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.