Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Conditional Running Tally - CR XI Post Reply Post New Topic
Author Message
AvalancheChaser
Newbie
Newbie


Joined: 17 Jan 2008
Online Status: Offline
Posts: 3
Quote AvalancheChaser Replybullet Topic: Conditional Running Tally - CR XI
     Posted: 17 Jan 2008 at 11:15am
I am fairly new to CR, and am having a tough time getting a couple things in my report to work as I want.  I have Googled and searched this forum, but haven't found my answer, so.....here I am.

I have a report that displays work orders that were closed within a user-defined date range.

In each group header I have a total work order count which works fine.  The piece that I am trying (unsuccessfully) to make work is a conditional count in the group header.  I have a Running Total field in the header; the Type of summary is set to sum (I also tried count), and under Evaluate I have chosen Use a formula.  Here is my formula:

if {database field for date completed} <= {database field for date due} then
1
else
0

I want this to tally all of the work orders that were closed on or before their due date.  When the report is run now, the Running Total field displays nothing.

Any help/direction is appreciated.

AC




Edited by AvalancheChaser - 17 Jan 2008 at 11:18am
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 17 Jan 2008 at 1:38pm
The problem is that running totals don't always work in headers.  You don't have the count until the group is completed, so it has to go in the footer.
 
However, there is a way around this using two formulas instead of a "running" total.
 
In the first formula, which I'll call "CompleteEarly", but the formula you used under "Evaluate":
 
if {database field for date completed} <= {database field for date due} then
1
else
0
 
In the second formula, put the following:
 
Sum({@CompleteEarly}, {group field from database})
 
Put this formula in your group header to get the info you're looking for.
 
-Dell
IP IP Logged
AvalancheChaser
Newbie
Newbie


Joined: 17 Jan 2008
Online Status: Offline
Posts: 3
Quote AvalancheChaser Replybullet Posted: 18 Jan 2008 at 9:00am
Thanks for the help!  That works great!

Two last questions that I'm now struggling with:

1) How might I go about totaling all of the values given in the group header by the second formula?

Ideally, I'd like this total to go in the report footer.

2) How do I tell CR not to repeat the group header on a second page if the details for that group run onto the next page?


Thanks so much for your help, I really appreciate it!

AC
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 18 Jan 2008 at 10:44am
1.  Try this for your total count:
 
 
2.  Right-click on the group header or footer in gray section to the left of the report.  Select "Change Group."  Go to the second tab (I don't remember off the top of my head what the label is...) and un-check the option to repeat the group header on every page.
 
-Dell
IP IP Logged
AvalancheChaser
Newbie
Newbie


Joined: 17 Jan 2008
Online Status: Offline
Posts: 3
Quote AvalancheChaser Replybullet Posted: 18 Jan 2008 at 11:41am
You d' man.

Thanks!




AC



IP IP Logged
Colonel45
Newbie
Newbie


Joined: 10 May 2011
Location: United States
Online Status: Offline
Posts: 35
Quote Colonel45 Replybullet Posted: 01 Jun 2011 at 8:30am
I need to running totals that are conditional. Similiar to the image below.
 
 
 
I tried to create two running totals:
 
1. Called Non- billable that used the following formula in the Evaluate section: {ODF_ECLIPSE_TIMESHEETS.billable_type} = 1
 
and never reset
 
2. Called billable that used the following formulate in the Evaluate section
{ODF_ECLIPSE_TIMESHEETS.billable_type} = 0
 
and never reset
 
I placed them in the group footer and neither display a value.
 
The field that I'm evaluating is supressed in the detail section.
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