Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Edit Running Total Field options Post Reply Post New Topic
Author Message
RichIcicle
Newbie
Newbie


Joined: 06 Jan 2011
Online Status: Offline
Posts: 33
Quote RichIcicle Replybullet Topic: Edit Running Total Field options
     Posted: 04 May 2011 at 10:33am
OK, here is a question that has a little more meat on it than my last question.
 
I have a report that consists of a CaseID header and Journal detail:

---

CaseID XYZ  Description       CaseID Total Hours            500.0

   Journal Detail                    Days Total Hours       2.0

   Journal Additional Detail                                     1.5

   Journal Additional Detail                                     1.0

 

Group Total                                                           4.5   1500.0 Confused

---

For each journal detail listed the group total accumulates, 500 * 3 journals = 1500.  So, the obvious answer is to go to the "Edit Running Total Field" and put a bullet in the Evaluate option "On change of group", giving me the correct Group Total of 500.

---

CaseID XYZ  Description       CaseID Total Hours            500.0

   Journal Detail                    Days Total Hours       2.0

   Journal Additional Detail                                     1.5

   Journal Additional Detail                                     1.0

 

Group Total                                                           4.5    500.0 Smile

---

However, this CaseID is a perpetual CaseID and I optionally don't want to see perpetual CaseID total hours.   To archive this, I use a true/false formula getting me the output below. 

---

CaseID XYZ  Description       CaseID Total Hours               0.0

   Journal Detail                    Days Total Hours       2.0

   Journal Additional Detail                                     1.5

   Journal Additional Detail                                     1.0

 

Group Total                                                           4.5       0.0 Smile

---

If I choose to view perpetual CaseID total hours I am back to the 1500 hours as in the first example... Confused
 
So, can you advise me how I can have my "On change of group" and "Use a formula" and eat it too!?

 

CR Developer; Product Type: full

Version 11.5.12.1838

 

Thanks,

Rich
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 04 May 2011 at 12:36pm
do you mean that you want the count reset after each caseid group?
in your RT change reset to on group and select the group of caseid.
IP IP Logged
RichIcicle
Newbie
Newbie


Joined: 06 Jan 2011
Online Status: Offline
Posts: 33
Quote RichIcicle Replybullet Posted: 04 May 2011 at 1:34pm
Well,
 
I do have the RT Reset On change of group selected.  My group is a date.  I am listing my total CaseID hours for the day and not for the CaseID.  I can have multiple CaseIDs for the day.  My test of your suggestion listed the day total equal to the last CaseID listed.
 
To clarify my problem a little:
 
My CaseID has a status, and the status can be Open, Closed, or Perpetual.  In the case of perpetual, the CaseID total hours can get quite large and meaningless to the reader.
 
I always want to see the CaseID on the report.
 
I have added a prompt to the report to include or exclude CaseID total hours when the CaseID status is perpetual.
 
I have put a bullet into RT Evaluate Use a formula and the formula is:
 
if {CallLog.CallStatus} = "Perpetual" and {?Include Perpetual Hours} = "No" then
    false
else
    true
 
This works to exclude the CaseID total hours from the report.
 
My problem happens when I want to include all CaseID total hours, and I have a CaseID with multiple journal entries.  Now my formula doesn't help.
 
And now thinking about it, if I have a CaseID with a status of Open and multiple journals, it would always be totalling too much as well...
 
So,
 
How can I make the report roll totals when the CaseID changes and not when the CaseID status is perpetual and I want to exclude perpetual hours?
 
Thanks


Edited by RichIcicle - 04 May 2011 at 1:36pm
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 05 May 2011 at 3:23am
Not sure I exactly understand what you want to accomplish but you can use a formula that incorporates the next() or previous() functions which can replicate the on change of field or group.
As an aside, i would try to not use if then statements where it wants  a boolean result
so it is something like:
(next(fielda)<>fielda and NOT({CallLog.CallStatus} = "Perpetual" and {?Include Perpetual Hours} = "No") or
next(fielda)<>fielda
 
 


Edited by DBlank - 05 May 2011 at 3:24am
IP IP Logged
RichIcicle
Newbie
Newbie


Joined: 06 Jan 2011
Online Status: Offline
Posts: 33
Quote RichIcicle Replybullet Posted: 05 May 2011 at 7:22am

That works!  Tongue

However, a new wrinkle, the formula is not getting my last CaseID into the totals...
 
What will Next(fielda) return at the end of data or end of file?  I added to the if statement "or isNull(next(fielda))" but that didn't help.
 
Thanks
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 05 May 2011 at 7:24am
if you always want to include the last record use
or onlastrecord


Edited by DBlank - 05 May 2011 at 7:25am
IP IP Logged
RichIcicle
Newbie
Newbie


Joined: 06 Jan 2011
Online Status: Offline
Posts: 33
Quote RichIcicle Replybullet Posted: 05 May 2011 at 7:46am
Thanks for your help!
IP IP Logged
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