Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: sum running total counts?? Post Reply Post New Topic
Author Message
jbalbo
Senior Member
Senior Member
Avatar

Joined: 17 Feb 2011
Online Status: Offline
Posts: 219
Quote jbalbo Replybullet Topic: sum running total counts??
     Posted: 06 Sep 2013 at 4:58am
Hi,

I have a running total of where there is no data in a field which resets on a date.

I then group on the date and surpress if the count = 0 .
I now want a total of all the dates with the running total of 0 so i can compute the total (total records-(Running total = 0)

Thanks
Joe

IP IP Logged
jbalbo
Senior Member
Senior Member
Avatar

Joined: 17 Feb 2011
Online Status: Offline
Posts: 219
Quote jbalbo Replybullet Posted: 06 Sep 2013 at 5:24am
a better ?? may be

How do I not count surpress records in a group total?


IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 06 Sep 2013 at 6:00am
use a "flag" formula field
//@flag - alter to handle nulls correctly and this assumes it is a string
if field="" then 0 else 1
group on the date field per day
insert a summary as a sum of the flag at the group level
now you should have a useable value for a running total
 
dictinctcount of the date using an evaluate formula sum(flag,date'"for each day")=0 reset = never will give your number
 


Edited by DBlank - 06 Sep 2013 at 6:03am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 06 Sep 2013 at 6:10am
note you can also use the group select satement to exclude the days with a sum of zero
(or suppress if you want)
if you use the group select to exclude then any running totals would excldue them becuase the RT is run in a pass after the group select pass.
Sum/count/average/etc. functions would still incude them
 
IP IP Logged
jbalbo
Senior Member
Senior Member
Avatar

Joined: 17 Feb 2011
Online Status: Offline
Posts: 219
Quote jbalbo Replybullet Posted: 06 Sep 2013 at 6:20am
Thanks for the formula..
I haven't tried it because i used a field to filter out the 0's..
then did a distinct count on the date part of the datetime

WHich bring me to another problem.

I now have the count of records for each client...

grp1 = location
grp2 = team
grp3 = client
grp4 = date
the distinctcount on date on the client level gives me the correct number
but now I want a total of each client on the team
so client A = 13, CLient = 12 total for team = 25

Thanks

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 06 Sep 2013 at 6:24am
can you exaplain further your data and what you re trying to get at?
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