Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Running Total Question Post Reply Post New Topic
Author Message
coachkrav
Newbie
Newbie


Joined: 21 Nov 2011
Online Status: Offline
Posts: 2
Quote coachkrav Replybullet Topic: Running Total Question
    Posted: 21 Nov 2011 at 10:09am
I am creating a report in which I need to calculate the sum of all jobs. I used a running total and tried putting a formula in my running total for having count(jobnum) > 1 and it did not work. In some cases my report shows multiple lines for the same job (which I need it to do), but I need sum all of the jobs that have different job numbers.

Ex:

Job Num   DocTotal     Color
1        $100        Red
2        $50          Blue
2        $50          Black
3        $100        White

Right now my result is $300. I need my result to be $250.

Can anyone help?
IP IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 21 Nov 2011 at 11:32am
try to create a formula
if its a total count then
distinctcount({job_id(field)}) place it report footer
IP IP Logged
coachkrav
Newbie
Newbie


Joined: 21 Nov 2011
Online Status: Offline
Posts: 2
Quote coachkrav Replybullet Posted: 01 Dec 2011 at 9:25am
I need to sum the doctotal field.

If there was a distinctsum I would be fine.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 01 Dec 2011 at 9:30am

one away is a running total

name=whatever you want
field to summarize=doctotal
evalaute=on change of field, jobnum
reset=never (for grand total)
place in report footer
 
IP IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 01 Dec 2011 at 9:36am
not sure if this will work
if distinctcount({job_id(field)})= 1 then sum({doctotal field})
or if there is a group
if distinctcount({job_id(field)})= 1 then sum({doctotal field},groupname)
IP IP Logged
comatt1
Senior Member
Senior Member
Avatar

Joined: 19 May 2011
Online Status: Offline
Posts: 337
Quote comatt1 Replybullet Posted: 02 Dec 2011 at 5:29am

Are job numbers listed sequentially in the report.B

By multiple lines, did you mean
 
Job Total Color
1   50
2   100
3   50
4   50
5   100
6   50
6   50
 
Like this?
 
What I would do is group by Job Number, have a running total for jobnumber using MAX (doctotal) as the type of summary.
 
evaluate the formula based on jobnum
 
and change on group.
 
....
 
 
You can have another running total that will add up the totals up this first running total
 
IP IP Logged
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.031 seconds.